How can I specify a drive in Applescript without the drive name? I had a main system drive on my iMac named &quot;Macintosh HD&quot; and wrote my scripts to reference files on that drive.  For instance, to get to my library directory, I had &quot;Macintosh HD:Users:me:Documents:Dev:AppleScript:&quot; as the full path.
The problem is that I'm having drive issues and need to replace my drive before it goes bad.  To keep track, I cloned my original system drive (&quot;Macintosh HD&quot;) to &quot;System Temp,&quot; which is connected by USB.  I can afford to use this drive for a few days, but need to return it to a server as soon as I can.  Early this week I'll be getting a new drive that will be the long term replacement drive, named, &quot;System.&quot;
I don't want to name each drive &quot;Macintosh HD&quot; because that makes it hard for me to keep track of them, but I'd like to keep the scripts working throughout the process.
How can I, in Applescript, specify a pathname to a drive without using the HD name?  If it's the main HD, what is the equivalent of the Linux form of &quot;/&quot; for the root file system, so I'd use &quot;/home/me&quot; to get to my home directory?  Is there some way to do something like &quot;::Users:me&quot; instead?  I just want to be able to tell Applescript something like, &quot;This is on the main system drive,&quot; or, &quot;Use the boot drive.&quot;
I tried a lot of possible alternatives and none worked.
Instead of using HFS file paths, use posix paths.
Use System Events for file operations, which handles posix paths as well as HFS paths.  It even knows how to expand the ~, so your home directory can be expressed simply as folder &quot;~/&quot;, and your main disk is mounted at folder &quot;/&quot;.
As for your attached USB drives, you essentially have to reference them by name.  They'll be listed under folder &quot;/Volumes&quot;, or you can use this command (via System Events):
get the name of every disk where it is ejectable -- i.e. attached drives

I'm not entirely able to tell if I've answered all your questions.  Leave a comment and I'll fill in whatever seems missing.