2012-06-15 40 views

回答

1

這是我寫的啓動Safari Inspector的AppleScript。您可以將其導出爲可執行應用程序,並讓它坐在碼頭中,只需單擊一下即可進入Inspector。您也可以在Xcode的構建階段啓動它,以便在應用程序發送到模擬器時運行它。根據需要將「iPad Simulator」更改爲「iPone Simulator」或連接的設備。

tell application "Safari" 
    activate 
    delay 2 
    tell application "System Events" 
     tell process "Safari" 
      set frontmost to true 
      click menu item 2 of menu 1 of menu item "iPad Simulator" of menu 1 of menu bar item "Develop" of menu bar 1 
     end tell 
    end tell 
end tell 
相關問題