Reputation: 350
Getting the following error when running my Applescript:
348:532: execution error: No result was returned from some part of this expression. (-2763)
The applescript runs successfully when utilized within a python script and there are no issues. But this error always is kicked back whenever the scipt executes and I would like to fix it. I have tried inserting an extra return statement into the if/else clause, but that doesn't seem to be the issue.
script="""
try
tell application "Finder" to get application file id "com.adobe.Photoshop"
set appExists to true
on error
set appExists to false
end try
if appExists then
tell application id "com.adobe.Photoshop"
(activate) & (do javascript file "%s" with arguments {"%s", "%s"})
end tell
else
return "Couldn't find proper version of Photoshop CC to launch!"
end if
""" % (script_path, src_files, self.path_to_folder)
Upvotes: 0
Views: 465
Reputation: 3422
I don’t have PhotoShop to test, but I'm pretty sure it is from the line with the do javascript
statement. The term activate
is a command to activate the application (and doesn’t return a result), while the ampersand (&) is used to concatenate strings, so you are trying to add a non-existent value to the javascript result.
It looks like you are wanting to use multiple statements on one line - you can’t do that with AppleScript (although in this case there isn't s syntax error), you need to put statements on separate lines.
Upvotes: 1