Skip to main content
Known Participant
December 25, 2020
질문

Photoshop script not working after updating to 2021

  • December 25, 2020
  • 3 답변들
  • 1646 조회

I have a Photoshop script (Javascript) that copy paste paths from one image to another. It has worked for a long time, but with PS 2021 (22.1.0) on Windows 10, I get an error in this code where the selected path is copied (3rd line),

1. currentDoc.pathItems[0].select();
2. var id122 = charIDToTypeID("copy");
3. executeAction( id122, undefined, DialogModes.NO );
"General Photoshop error occurred. This functionality may not be available in this version of Photoshop"

Everything works fine up to that line of code, image with path (currentDoc - this is the active document) is open in Photoshop and path is selected as intended and the destination image also open. Variable id122 has an int value too.

Any idea how to fix this error?

Thanks

이 주제는 답변이 닫혔습니다.

3 답변

PECourtejoie
Community Expert
Community Expert
December 25, 2020

Hi, I suggest to search or create a thread on the https://feedback.photoshop.com site, watched by Adobe staff. Make sure to provide as many relevant details as possible.

Known Participant
December 26, 2020
Chuck Uebele
Community Expert
Community Expert
December 25, 2020

Not sure about your issue but I've run across another bug with the new PS and paths. Using AM code to change a path into a shape no longer works. The shape layer is made but the path in it just disappears 

JJMack
Community Expert
Community Expert
December 25, 2020

That is an Action Manager code step that seem to reqire an active Path or Selection for a copy of some kind. If one does not exists the copy command will mot be avaiable.  The is a typical message one gets when some document requirement is not satisified. line 1. currentDoc.pathItems[0].select(); ?

JJMack
Known Participant
December 25, 2020

Thanks for looking into this. The script worked fine in previous versions until 22.1.0

Line that throws the error is,

executeAction( id122, undefined, DialogModes.NO );

 

Line,

currentDoc.pathItems[0].select();

works fine, the source image (which has the clipping path) and the destination image (to which the script is supposed to copy the path) are open in Photoshop and the first clipping path in source image is selected.

The error is thrown when copying this selected path.

Wonder why only the latest Photoshop version throws this error.

Thanks