我编写了我的applescript应用程序来隐藏我的无线网卡的窗口。 我遇到了一些问题,如果检查窗口是可见或不可见(避免命令+ H按键没有影响),所以我决定用delay 15
使(不是全部)确认窗口弹出。如果我从编辑器运行脚本或双击应用程序文件,它可以工作,但如果我将它设置为从用户登录开始(在设置>帐户>登录元素下),它不起作用! 我试图改变复选框中Save as...
页的AppleScript编辑:我尝试都设置为only execute
,但任何变化。 与start screen
选项实际上它的工作原理,但它问我一个确认,我不希望它(我会优先按cmd + h代替)。 任何人都可以解释为什么我有这个问题?Applescript在OSX启动时无法运行
tell application "System Events"
set progList to (name of every process)
set cond to false
repeat while cond is false
if (progList contains "WirelessUtilityCardbusPCI") is true then
delay 5
activate application "WirelessUtilityCardbusPCI.app"
tell application "System Events" to keystroke "h" using [command down]
set cond to true
else
delay 5
set progList to (name of every process)
end if
end repeat
end tell
编辑:现在它似乎工作!我忘了重新编号set progList to (name of every process)
。现在代码是正确的。
需要看到的代码。 – regulus6633 2011-05-26 16:26:19
对不起,但我不认为代码可以改变一些东西。 – Paciotti 2011-05-27 09:09:01