I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this:
set js to "app.document.selections[0].spec.parent.name;" # parent of 1st selected image
tell application "Adobe Bridge CS5.1" # target adobe product
set theResult to do javascript js # fire away, waiting for return value
end tell
The javascript reports the correct value — I tested the output within Bridge via alert
. Alas, the do javascript
command does not return any value, so I added an explicit return
statement:
set js to "return app.document.selections[0].spec.parent.name;"
throws an error in AppleScript Editor.app:
error "Adobe Bridge CS5.1 got an error: AppleEvent handler failed." number -10000
What am I doing wrong? NB: I just need the path, I don’t care about how it is done.
Best Answer
I think you would have to go via Photoshop using BridgeTalk to get the path.