Setting the default folder by dragging and dropping

hey all, you can set the current folder of any open and save dialog box by drag and droppin a folder from the finder onto the dialog box. This is a big help when having to browse network folders. Does anyone know if this can be done programmatically from Applescript? something like the bogus code below?

tell app “QuarkXpress 6” to set target of dialog box 1 to target path of finder window 1

if not does anyone know if default folderX will let you do something like that? i remember akua sweets in os 9 had something that would work every now and again.
-syd

In Mac OS X 10.3, in the Open/Save dialogs, you can hit “Command-Shift-G” to “goto” any path. So, using a bit of GUI scripting, you can get what you want using this script (sorry, I don’t have QXP 6 to test):

set the_app to "Safari"
set desktop_posix to (POSIX path of (path to desktop as string)) --the posix path to your desired target location
tell application the_app to activate
tell application "System Events"
	tell process the_app
		delay 1
		keystroke "o" using command down --lowercase o
		delay 1
		keystroke "G" using command down --uppercase G
		delay 1
		keystroke desktop_posix
		delay 1
		keystroke return
	end tell
end tell

Jon

Jon,
Thanks for your help. I can’t speak for the OP, but you’ve helped me fix one of my scripts. See this thread. :smiley: