Skip to main content
Known Participant
September 7, 2021

P: Using AppleScript – Could not complete the command because of a program error.

  • September 7, 2021
  • 14 replies
  • 7504 views

Since upgrading Photoshop to 22.5.0 on my Mac OS 11.5.2 I have a problem with the following command in all my AppleScripts that feature it:

 

make new path item with properties {entire path:PathDetails, name:"Path Name", kind:normal}

 

Photoshop will throw the error "Could not complete the command because of a program error.", but will continue on and execute the above command anyway.

 

I have wound back Photoshop to the previous version and the expected behaviour is restored.

This topic has been closed for replies.

14 replies

Known Participant
February 18, 2022

Fantastic thanks for fixing, I can confirm it is working as expected for me now!

Mohit Goyal
Community Manager
Community Manager
February 17, 2022

Hi all,  

 

We're happy to announce the release of Photoshop 23.2. This update includes the fix for this issue. To see the list of all fixed issues, click here

 

To update Photoshop to 23.2, click "Update" in the Creative Cloud desktop app next to Photoshop. More detailed instructions for updating  

 

Let us know if the update resolves the problem for those affected and share your feedback with us.  

 

Thanks,

Mohit

Legend
February 9, 2022

Yes. Should be addressed in an upcoming update. Will update the thread when it is released.

Participating Frequently
February 7, 2022

Hey @J453 

 

Is there any progress on this one? 

Adobe Employee
November 19, 2021

Using "System Events" to dismiss the dialog is not a solution at all. We are actively working on one. This is provided as a workaround to temporarily unblock you from the program error. I could confirm that "Script Editor" compiled app does not dismiss the dialog.

Known Participant
November 19, 2021

Hmm, once I had my coffe and realised I hadn't updated my script properly as JonathanLo explained it just worked for me. I think I did have to grant extra privlidges in the Security & Privacy Settings of the OS, I can't remember excatly what it was now. I have given AppleScript Editior Accessbility and Full Disk Access. Photoshop has Full Disk Access on my Mac.

 

Not a fan of all Apple's changes to AppleScript, I am just a graphic artist that tinkers in scripting and they've made it so much more difficult to write and deploy scripts to my collegues; I feel like you need to be a full time scripter/programer to keep up now.

Participating Frequently
November 18, 2021

To follow up: This workaround is failing for me so I'm hoping for an offical fix still.

 

From my script IDE if I enable assistive access, then it will work. Not ideal but ok. 

When complied and run as an .app however, with same assistive options for PS enabled, it still fails and does not clear the error window. 

 

I may be doing something wrong however, I'd be interested to see how you are addressing the document object or if you have any other special stuff enabled. 

 

MacOS 11.6/PS 23.0.1

Known Participant
November 16, 2021

Forget my response here, I clearly haven't had my coffee yet this morning, and for some reason can't edit or delete my post! I had several spots in my script that needed addressing and forgot to edit the part I needed for the job I tested with.

Known Participant
November 16, 2021

Thanks, although, I just tested and it doesn't work – actually I think that is another bug in Photoshop, I have never had luck using ignoring application responses in Photoshop, I know I have tried in the past with a different function that was creating the same irrelevant error, I just can't remember the specific details. To be honest AppleScript in general doesn't perform that well in Photoshop or Illustrator, I wish it was effortless as it is in InDesign – however, it might push me to get more comfortable with JavaScript some day.

Adobe Employee
November 16, 2021

If the dialog stop your work flow, there is a woraround with the following command in AppleScript:

ignoring application responses

    make new path item with properties {entire path:PathDetails, name:"Path Name", kind:normal}

    tell application "System Events" to tell button "OK" of window 1 of process appName to click

end ignoring

Where the "appName" is either "Adobe Photoshop 2021" or "Adobe Photoshop 2022"

This should teporarily unblock you from using your script. Thanks.