Veteran Member
Join Date: Oct 2004
|
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? Code:
get selectedFile
tell application "Adobe Photoshop CS3"
activate
end tell Regards |
quote |
‽
|
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: Code:
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:Code:
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. |
quote |
Veteran Member
Join Date: Oct 2004
|
Sorry. That was a bit vague. The file is already selected in the finder. Then invoke it through Launchbar or something similar.
Regards |
quote |
‽
|
I've amended my post with working code.
|
quote |
Veteran Member
Join Date: Oct 2004
|
Chucker, thanks so much. I really appreciate it!
|
quote |
Posting Rules | Navigation |
|
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Learning AppleScript | jdcfsu | Programmer's Nook | 10 | 2009-08-05 14:38 |
A new post: Applescript | prestigerg1570@aim.com | Programmer's Nook | 16 | 2006-10-03 09:51 |
Help with applescript: how to get a url with specified name | ironlung | Programmer's Nook | 4 | 2006-05-01 03:52 |
Applescript problem | pmazer | Programmer's Nook | 1 | 2005-12-08 01:15 |
Audio applescript | ericarthur | Genius Bar | 0 | 2005-03-03 17:16 |