View Full Version : Using 'Get' command in Applescript
Hi there,
I'm trying to get an application to open a highlighted/selected file and then open it. The file is not the same every time so I cannot define it in the script.
Where am I going wrong?
get selectedFile
tell application "Adobe Photoshop CS3"
activate
end tell
Regards
I'm confused. Is the file selected in Finder? If so, how are you invoking the script? Or would you like the script to prompt the user for a file to choose?
If it's selected in Finder, try something like this:
tell application "Finder"
set theFile to the selection as alias
end tell
tell application "Adobe Photoshop CS3"
activate
open theFile
end tell
If you wish the user to choose a file, that would be:
set theFile to choose file
tell application "Adobe Photoshop CS3"
activate
open theFile
end tell
These scripts were both tested, albeit with Preview, not Photoshop.
Sorry. That was a bit vague. The file is already selected in the finder. Then invoke it through Launchbar or something similar.
Regards
I've amended my post with working code.
Chucker, thanks so much. I really appreciate it! :)
vBulletin® v3.6.4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.