2013-02-23 83 views

回答

0

我发现了两个脚本合并时,让我为她创建两个Automator的服务:the core applescript再怎么检测if the checkbox is already on or off

on run {input, parameters} -- use for both Automator services except for false/true below 
    tell application "System Events" 
     tell process "Safari" 
      click menu item "Preferences…" of menu "Safari" of menu bar item "Safari" of menu bar 1 
      click button "Security" of tool bar 1 of window 1 

      set theCheckbox to checkbox "Enable Java" of group 1 of group 1 of window "Security" 
      tell theCheckbox 
       set checkboxStatus to value of theCheckbox as boolean 
       if checkboxStatus is false then click theCheckbox 
       -- false for the 'Enable' script, true for the 'Disable' one 
      end tell 
      click button 1 of window "Security" 
     end tell 
    end tell 
    return input 
end run 
相关问题