• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
3

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

Explorer ,
Sep 06, 2021 Sep 06, 2021

Copy link to clipboard

Copied

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.

Bug Fixed
TOPICS
Actions and scripting , macOS

Views

6.8K

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 Employee , Nov 16, 2021 Nov 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.

Votes

Translate

Translate
Adobe Employee , Nov 16, 2021 Nov 16, 2021

Thanks for reporting. Engineering is looking into this. 

Status Started

Votes

Translate

Translate
14 Comments
Community Beginner ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

Same here. Spent an hour debugging but very little script side to go on. Guess roll back or wait for fix...

Votes

Translate

Translate

Report

Report
Explorer ,
Nov 02, 2021 Nov 02, 2021

Copy link to clipboard

Copied

Confirmed the problem still exists in Photoshop 2022, my work around to use the latest is to catch the error in script, although it doesn't supress the error message, at least by doing so it will let the script continue. The multiple errors get tedious to clear unfortuntately.

Votes

Translate

Translate

Report

Report
Community Beginner ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

Yep. Its no work around for me as I have multiple paths made and the error dialog blocks. I have verified my own scripts work on Photoshop 21 (22.0.0 and 22.4.3)... so something fell off ~22.5 like you say. I have opened a ticket and reported the bug with steps to repro. 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

Thanks for reporting. Engineering is looking into this. 

Status Started

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Explorer ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Explorer ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community Beginner ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Explorer ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community Beginner ,
Feb 07, 2022 Feb 07, 2022

Copy link to clipboard

Copied

Hey @J453 

 

Is there any progress on this one? 

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Adobe Employee ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

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

Status Fixed

Votes

Translate

Translate

Report

Report
Explorer ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report