Apply Dropshadow Live Effect

Guru ,
May 06, 2018 May 06, 2018

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

TOPICS
Scripting

Views

605

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct Answers

Adobe Community Professional , May 06, 2018 May 06, 2018
Hi Trevorׅbased on the findings of Silly-V​ and CarlosCanto​ the code should bevar 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

Likes

Translate

Translate
Engaged , Feb 04, 2021 Feb 04, 2021
Update: these free functions make applying Live Effects easier: AI Live Effect Functions.- Mark

Likes

Translate

Translate
Guru ,
May 06, 2018 May 06, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 06, 2018 May 06, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 06, 2018 May 06, 2018

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 04, 2021 Feb 04, 2021

Copy link to clipboard

Copied

LATEST

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

- Mark

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines