登录后如何激活AppleScript?


Answers:


12

如果您将Apple Script保存为应用程序,则转到系统偏好设置->用户->登录项目,您可以在其中添加该应用程序,它将在登录时运行。

在此处输入图片说明


2

〜/ Library / LaunchAgents / login_test.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>login_test</string>
    <key>ProgramArguments</key>
    <array>
        <string>osascript</string>
        <string>/Users/username/Desktop/test.scpt</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

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.