AppleScript: Help With Open Location Script

Discussion in 'Mac Programming' started by dylanweber, Aug 7, 2009.

  1. dylanweber macrumors newbie

    Joined:
    Jul 14, 2009
    Location:
    USA
    #1
    The script I have so far is:

    Code:
    set setLocation to text returned of (display dialog "Put path below (can contain ~)" default answer "~/" buttons {"OK", "Cancel"} default button 1)
    tell application "Finder" to activate
    tell application "System Events" to keystroke "G" using {command down, shift}
    tell application "System Events" to keystroke setLocation
    tell application "System Events" to keystroke return
    Is there a better script then that? If there is could you please reply.
    ______________________________
    PROBABLY MADE ON A MAC
    :apple:
    APPLESCRIPT
    ______________________________
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    There's probably a Finder way, but this should work as well:
    Code:
    set setLocation to text returned of (display dialog "Put path below (can contain ~)" default answer "~/" buttons {"OK", "Cancel"} default button 1)
    do shell script "open " & setLocation
     
  3. dylanweber thread starter macrumors newbie

    Joined:
    Jul 14, 2009
    Location:
    USA
    #3
    Thanks.

    I was thinking about that before, then forgot about. Thanks.
     

Share This Page