Strange Behavior by Photoshop CC 2019

When I try to run the following script from either Script Debugger or Script Editor, the script behaves as expected, it outputs a jpg of whatever the front document is currently open in Photoshop.

But when I turn this script into an app, standard or run only, Photoshop appears to be getting instructions from the script, but it never outputs anything.

set pathToMe to ((path to me)) as string
set theFile to "4080.jpg"
set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {":"}}
set savePath to (((text items 1 thru -2 of pathToMe) & theFile) as string)
set AppleScript's text item delimiters to saveTID
tell application "Adobe Photoshop CC 2019"
	set theDoc to document 1
	tell theDoc
		export as save for web in file savePath with options {class:save for web export options, web format:JPEG}
	end tell
end tell

I am running on 10.13 and using Adobe Photoshop CC 2019

Can anyone else confirm they are having this same issue on their machine? I have tested it on both my MacBook and iMac that are both on 10.13. Even better, could someone give me any hints as to why this might be happening and how I might fix it!


Your problem seems to be the destination path for your export pic.

The script exports your picture besides your applescript, which is inside your appliction bundle.
Look inside your bundle (rigth click on your, open package/bundle).

You can replace your ‘path to me’ with a fix destination path, choose destination via choose folder or when your script do the export besides your change the ‘text items 1 thru -2’ to ‘text items 1 thru -3’.

Not sure why that was not readily apparent to me. Thanks for pointing out my boneheaded mistake.:smiley: