2013-05-18 57 views
0

我試圖用一個使用UI的applescript單擊我在谷歌瀏覽器中名爲「WatchADay」的書籤文件夾,然後點擊該文件夾中的打開所有標籤頁。這是我試過的。用Applescript點擊一個Chrome書籤文件夾

tell application "Google Chrome" to activate 
delay 1 
tell application "System Events" 
    tell process "Google Chrome" 
     --click menu item "Open All Bookmarks in New Window" of menu item "WatchADay" of menu "Bookmarks" of menu bar 1 

     --get menu items of menu "Bookmarks" of menu bar 1 
     get menu items of menu item "WatchADay" of menu "Bookmarks" of menu bar item "Bookmarks" of menu bar 1 
    end tell 
end tell 

即使在WatchADay文件夾中有書籤,此代碼也會返回{}。我試過的其他代碼似乎立即崩潰了Chrome。

我不知道該怎麼做,所以我希望你能幫上忙。

謝謝!

而且,我的Chrome是26.0.1410.65 而我在爲10.6.8操作系統

回答

0

嘗試:

activate application "Google Chrome" 
tell application "System Events" 
    tell process "Google Chrome" 
     click menu item "Open All Bookmarks in New Window" of menu 1 of menu item "WatchADay" of menu 1 of menu bar item "Bookmarks" of menu bar 1 
    end tell 
end tell