Copy link to clipboard
Copied
Hi all , how to retrieve the details of drop shadow effects of the image in illustrator using script.
Thank you.
Copy link to clipboard
Copied
Hi all, here I’ve attached the image, that image has been applied drop shadow , I want to retrieve the drop shadow details using script, can please anyone help me to get the solution.
Thank you.
Copy link to clipboard
Copied
Hi @Abpujar, as far as I know, you can't get the details of the drop shadow. You can set the drop shadow (using Live Effects), but once it is set, you cannot get it's details.
Maybe it would be possible to export the document as svg, then load the svg as text and derive the dropshadow details from the svg markup? I doubt it would work because it probably rasterizes the dropshadow. Maybe you could measure the dimensions of the rasterized dropshadow image and compare to the page item, and work out the size of the dropshadow? I doubt you could get an unambiguous result. Sorry not much hope from me. Maybe someone has an idea?
- Mark
Copy link to clipboard
Copied
Hi @m1b thank you so much for the reply. We can apply drop shadow effect through script but how can we retrieve those details?? Please help me i didn't get any solution to retrieve drop shadow effect.
Copy link to clipboard
Copied
I think there is two ways to do that. But we need to remember that Ai adds raster effects to stroke.
Method 1
Just draw a transparent rectangle on image with 0,5 pt stroke and add effect. that can mimic shadow effect.
Method 2.
Copy link to clipboard
Copied
Hi @Ares Hovhannesyan, very interesting! So you could read the strokeWeight of the shape as a proxy for the drop shadow size? Am I following you?
- Mark
Copy link to clipboard
Copied
Yes absolutely. and remember that dropshadow and many other effect are raster effect.
Copy link to clipboard
Copied
@Abpujar, is your script also applying the dropshadow? Or is it already there?
- Mark
Copy link to clipboard
Copied
you could save the file "uncompressed", then open the file with a text editor to see all details. Yes, you could do this with javascript as well.
Copy link to clipboard
Copied
Hi @m1b I’ve applied drop shadow manually to the image. now I want to retrieve the values through script.can you please help me.
Copy link to clipboard
Copied
Hi all, we can apply angle and distance in drop shadow effect, can please anyone help me , how to apply angle and distance value of drop shadow effect here ?
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>';
app.documents[0].selection[0].applyEffect(xmlstring) ;
Copy link to clipboard
Copied
Oooops!! I was comparing it with indesign. In indesign we can adjust the angle of the drop shadow using angle, but in illustrator we can adjust offset value to change the angle of the drop shadow.
Is there any solution to Retrieve Drop Shadow details through script? I didn’t find any solution .
Copy link to clipboard
Copied
Anyone with the solution?