方法1
tell application "System Events" to set isRunning to exists (processes where name is "Mail")
if not isRunning then
tell application "Mail" to activate
repeat until isRunning
tell application "System Events" to set isRunning to exists (processes where name is "Mail")
end repeat
end if
方法2
on appIsRunning(appName)
tell application "System Events" to (name of processes) contains appName
end appIsRunning
if appIsRunning("Sparrow") then
tell application "Sparrow"
tell application "System Events"
key code 120 ---f2按键
end tell
end tell
else
本文介绍了一种利用Apple Mail应用的自动化脚本来实现激活与检查功能的方法,包括如何判断邮件应用是否运行,以及如何在未运行时激活并确保其运行状态。
1万+

被折叠的 条评论
为什么被折叠?



