0
votes

UPDATE: I guess what I really need to be able to do is to determine the Volume Name of the Boot Drive under Mac OS.

As an explanation of what I mean by "Fully Qualified", on Mac OS it would start with "/Volumes/" or on Windows with a drive letter (such as "C:\")

for example I want the Mac path "/Users/bryandunphy/Music" to become "/Volumes/'current default drive'/Users/bryandunphy/Music" or "'computer Name'/Volumes/'current default drive'/Users/bryandunphy/Music"

I need this to select a path supplied on the command line in a drop-down box that lists "'computer name'", "'each volume in /Volumes separately'", then you would select from the directories on the selected volume.

I already tried putting an Absolute Path in the "Filename" box but it ignored the path and just kept the name.

I have a photo of the initial drop-down box if anyone can suggest somewhere to upload it to so I could put a link to it in this question.

1
There is no conceot of a "current default drive" in macOS or Linux. There's just one filesystem that starts at / and everything, external, internal or otherwise, is mounted at some point into that filesystem. You can't change drive - it's just one single, beautiful, uniform hierarchy without A: (might be floppy), B: (might be floppy), C: (probably what you want), D: (might be a CD-ROM, or missing)... - Mark Setchell
@Mark Setchell - The MAC OS drop-down box forces me to start at the computer name (which I already handle) then select a VOLUME NAME then I can select directories. - Bryan Dunphy

1 Answers

0
votes

In AppleScript you can get the name of the startup volume with

set startupVolume to boot volume of (system info)

There are two different representations of paths in AppleScript:

  • HFS path, colon separated, starts always with a disk name:

    "Macintosh HD:Users:myself:Desktop:"
    "Backups:Path:To:File.ext"
    
  • POSIX path, slash separated, starts always with a slash representing the startup volume:

    "/Users/myself/Desktop/"
    "/Volumes/Backups/Path/To/File.ext"