In AppleScript if I say:
tell app “TextEdit”
open “:users:bruce:documents:TextTest.rtf”
end tell
– Everything is OK. The TextEdit file “TextTest.rtf” opens as expected
However, in AppleScript Studio if I set up a simple button with the script:
on clicked theObject
tell app “TextEdit”
open “/users/bruce/documents/TextTest.rtf”
end tell
end clicked
– I get the error message- “TextEdit Open Failed. Couldn`t open file /users/bruce/documents/TextTest.rtf”. Why?
There must be one simple little step Im missing but Ive tried the documentation and can`t seem to find the answer. Any help would be greatly appreciated. :?:
I`m wondering why no one is able to answer this question. Is it so easy that everyone is assuming I was joking or is opening files in AppleScript Studio more complicated than a simple “open” command like in AppleScript. Please give me a comment one way or another,…even just to say “Hi”.
Why do you think you need to switch to a POSIX path? In both cases you are telling the app TextEdit which, oddly enough, accepts a string as a path but it must be a Mac style path, not a POSIX path.
Youre right. Why was I using a POSIX path? I guess Ive really only opened movie and sound files in AppleScript Studio and for the load command you have to use the POSIX path. (At least I think you do. Anyway thats the way Ive always done it. Except, of course, if you have the media added to the project resources.) Anyway, you helped me out and I`m back on track.
For the load command inside an AS Studio app, since you’re telling that AS Studio app, you need to use POSIX paths but when you’re telling other target apps, you need to use the path style required of that target app (for most applications that you can script via AppleScript, that will be a Mac-style path).