Skip to main content
Trevor:
Legend
May 6, 2018
Answered

Apply Dropshadow Live Effect

  • May 6, 2018
  • 2 replies
  • 1452 views

Hi All

I am trying to apply a drop shadow live effect.

The post is very helpful PageItem.applyEffect(LiveEffectXML)

The fxg string I get is

<ai:LiveEffect index="0" major="1" minor="0" name="Adobe Drop Shadow">

  <ai:Dict data="B pair 1 R opac 1 R dark 100 R horz 7 R blur 0 I csrc 0 I blnd 0 R vert 7 B usePSLBlur 1 I Adobe Effect Expand Before Version 16 ">

    <ai:Entry name="sclr" valueType="F">

      <ai:Fill color="1 0.75 0.68 0.67 0.902"/>

    </ai:Entry>

  </ai:Dict>

</ai:LiveEffect>

I am stuck how to convert this into the LiveEffectXML string

The effects demonstrated in the above post and the links found on it don't have the extra <ai:Entry> tag, I don't know what to do with it.

I'm also confused by the last bit

I Adobe Effect Expand Before Version 16 "

I would think all the spaces between the words is going to cause trouble also I don't know why there's a space after the integer 16 ?

Has anyone figured this out?

Regards

Trevor

This topic has been closed for replies.
Correct answer m1b

Update: these free functions make applying Live Effects easier: AI Live Effect Functions.

- Mark

2 replies

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
February 4, 2021

Update: these free functions make applying Live Effects easier: AI Live Effect Functions.

- Mark

Trevor:
Trevor:Author
Legend
May 6, 2018

P.s. I tried to record an action of applying a drop shadow but that didn't work either

I can't use graphics styles as the wouldn't exists

pixxxelschubser
Community Expert
Community Expert
May 6, 2018

Hi Trevorׅ

based on the findings of Silly-V​ and CarlosCanto​ the code should be

var idoc = app.activeDocument;

var ipath = idoc.selection[0];

xmlstring = '<LiveEffect name="Adobe Drop Shadow"><Dict data="R vert 7 R opac 0.75 B pair 1 R dark 100 R horz 14.655 R blur 5 I blnd 1 I csrc 0 "/></LiveEffect>';

ipath.applyEffect(xmlstring);

Have fun with testing

Trevor:
Trevor:Author
Legend
May 7, 2018

Hi pixxxel schubser

Excellent, so the answer was to ignore the things I didn't understand and just remove them.

Thanks a million.

Trevor