Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

3 Votes
Community Beginner ,
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 Started
TOPICS
Actions and scripting, macOS

Views

196

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 clickend ignoringWhere 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
10 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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
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 guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 16, 2021 Nov 16, 2021

Copy link to clipboard

Copied

Thanks for reporting. Engineering is looking into this. 


Senior Product Manager - Customer Advocacy - Digital Imaging
Bug Started

Votes

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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
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 guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

LATEST

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 guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines