Skip to main content
MarkWalsh
Inspiring
May 1, 2024
Answered

Relink or update placed image to apply photoshop clipping path with Javascript

  • May 1, 2024
  • 1 reply
  • 291 views

Is there a way to update a placed image to apply the Photoshop Clipping Path via Javascript? I need to use the path associated with a placed image in a script, but can't be sure that it was placed with the path, as with the import options dialog below.

I have tried setting app.epsImportPreferences.epsFrames to true, and using placedImage.relink() with both a filepath and a file object, but it doesn't apply the path. I also tried placedImage.reinitLink(), but wasn't able to get that to work either.

 

Is this not possible with Javascript?

This topic has been closed for replies.
Correct answer MarkWalsh

I finally figured it out. After a long time yesterday trying everything I could find, I came across this, which works to embed the path:

 

myGraphic.clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH

1 reply

MarkWalsh
MarkWalshAuthorCorrect answer
Inspiring
May 1, 2024

I finally figured it out. After a long time yesterday trying everything I could find, I came across this, which works to embed the path:

 

myGraphic.clippingPath.clippingType = ClippingPathType.PHOTOSHOP_PATH