What is the proper Applescript syntax for opening a file on a networked volume? The networked volume has the same name as the local hard drive, Macintosh HD, and is mounted on the desktop.
tell application “Finder”
open “Macintosh HD:folder name:file name”
but that opens the file on the local drive if it exists or returns an error if the file doesn’t exist locally. (Finder got an error - Can’t get file: “Macintosh HD:folder name:file name”)
I also tried:
do shell script “open /Volumes/Macintosh HD/filename.JPG”
but that gives an error when I check the syntax -
Expected “”" but found unknown token,
and leaves the space after the backslash highlighted.
After I posted, I did some more searches and came up with this (ironic) post:
Post subject: Nevermind: FAQ first, from now on, I swear. ª¶: )
From the FAQ
Quotes and backslashes are control characters in AppleScript. Therefore, you’ll need to escape these characters with preceeding backslashes when you write your code. For example…
set theString to ““This is a sentence wraped in quotes.””
→ “This is a sentence wraped in quotes.”
set theString to “This is a sentence containing a backslash ().”
→ This is a sentence containing a backslash ().
You need to ask the “Finder” of the machine you are connecting to for that…
tell application "Finder" of machine "some-machine-name [or IP address]"
You may need to connect via ‘afp’ or ‘eppc’ – like afp://username:paswrd@IPAddress/VolumeName