PDA

View Full Version : AppleScript: Help With Open Location Script




dylanweber
Aug 7, 2009, 12:36 PM
The script I have so far is:

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
______________________________



kainjow
Aug 7, 2009, 12:51 PM
There's probably a Finder way, but this should work as well:
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

dylanweber
Aug 10, 2009, 04:21 PM
I was thinking about that before, then forgot about. Thanks.