2009年4月6日 星期一

自动打开Safari的秘密浏览模式

用AppleScript模拟菜单点击,实现自动打开Safari的秘密浏览模式,然后导出来的一个app就能方便的在Spotlight里执行了。AppleScript真的是很强大。



脚本内容如下:
activate application "Safari"
tell application "System Events"
tell process "Safari"
click menu item "秘密浏览" of menu 1 of menu bar item "Safari" of menu bar 1
if exists button "OK" of window 1 then
click button "OK" of window 1
end if
end tell
end tell


在“脚本编辑程序”里将其存储为“应用程序”,取消勾选“启动屏幕”,保存即可。


可以将这个app拖到“应用程序”目录里方便,就可以随时用Spotlight方便的调用了。

0 评论:

发表评论