2012-08-25 120 views
0

是否可以使用AppleScript打開最近的文件? 我試過下面的腳本,但它不起作用。AppleScript打開「打開最近」文件

on run 
    try 
     tell application "System Events" 
      set theApp to (get name of first process whose frontmost is true) 
      click menu bar item "Archivio" of menu bar 1 of process theApp 
      click menu item "Apri recente" of menu "Archivio" of menu bar item "Archivio" of menu bar 1 of process theApp 
      click menu item " test" of menu "Apri recente" of menu item "Apri recente" of menu "Archivio" of menu bar item "Archivio" of menu bar 1 of process theApp 
     end tell 
    end try 
end run 

該錯誤是

- >錯誤號-1728從«類menI»«類menI» 「APRI最近搜索」 的«類MENE» 「APRI最近搜索」 的 「測試」 «類梅內»«類mbri»的「ARCHIVIO」的「ARCHIVIO」«類巴勒斯坦紅新月會»「的AppleScript編輯器」

回答

1

這似乎是一個錯誤的«類毫巴»1時,「APRI最近搜索」子菜單已打開。 但這不是必需的,你可以在一次點擊中完成。

tell application "System Events" 
    tell (get first process whose frontmost is true) 
     click menu item " test" of menu "Apri recente" of menu item "Apri recente" of menu "Archivio" of menu bar item "Archivio" of menu bar 1 
    end tell 
end tell