Copy link to clipboard
Copied
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
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
Update: these free functions make applying Live Effects easier: AI Live Effect Functions.
- Mark
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi pixxxel schubser​
Excellent, so the answer was to ignore the things I didn't understand and just remove them.
Thanks a million.
Trevor
Copy link to clipboard
Copied
Update: these free functions make applying Live Effects easier: AI Live Effect Functions.
- Mark