AppleScript Help

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

  1. macrumors member

    Joined:
    Jul 7, 2011
    #1
    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"
    activate
    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.

    ~JV
     
  2. macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    This will give you the startup disk eg Macintosh HD as alias

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

Share This Page