Applescript file dialog with UI scripting
I am trying to open a file in a not so scriptable area of an application.
I got halfway there by using UI scripting to select the proper menu item, but this opens a standard file 开发者_JAVA百科dialog.
How can I set the destination of the file dialog with Applescript?
ahh ok this should get you going on the right path
tell application "Safari"
activate
-- do menu select gui script first
set posixpath to "/path/to/a/folder/that/exists"
tell window 1
tell application "System Events"
keystroke "g" using {shift down, command down}
keystroke posixpath
delay 1
keystroke return
end tell
end tell
end tell
精彩评论