AppleScript Help

Discussion in 'Mac Programming' started by Johnny Vegas, May 16, 2012.

  1. macrumors member

    Jul 7, 2011
    I'm trying to write a script that will open a specific folder. The only problem is that it needs to be run on multiple machines with different Hard Drive names. Here is a sample of the script that will work on my machine.

    tell application "Finder"
    open folder "HDD:Volumes:USERData:Users:Staff:Name"
    end tell

    Is there anyway to change "HDD" to whatever the current users Hard Drive is named?

    Thanks for the help.

  2. macrumors 6502a

    Mar 17, 2012
    This will give you the startup disk eg Macintosh HD as alias

    path to startup disk
    --or as text
    (path to startup disk as text) & "Volumes:USERData:Users:Staff:Name"

Share This Page