开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜