如何在隐藏时在登录时运行脚本


0

我有一个Applecript(scpt)脚本,我想在用户登录时运行。 我希望脚本在菜单栏,菜单栏等中不可见(这可能意味着在后台运行它或其他东西。)

最好的方法是什么?

最好,我希望脚本是自动运行不容易注意到。此外,一种从登录中轻松删除脚本的方法会很有帮助。

如果需要,我会附上脚本的副本。 这应该是使用say命令的恶作剧,任何改进脚本的提示都会很好;)

Answers:


1

而不是发射 终奌站 你可以做类似的东西:

repeat
    delay (random number from 1 to 5) -- Change the delay in seconds
    do shell script "say Hello"
end repeat

您可以将其另存为应用程序,然后更改其Info.plist文件以将其从Dock中隐藏。只需在里面添加这一行 Hello.app/Contents/Info.plist

<key>LSUIElement</key>
<true/>

在登录时启动它您可以将此应用程序添加到登录项目。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.