Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nateswart/8329172 to your computer and use it in GitHub Desktop.
Save nateswart/8329172 to your computer and use it in GitHub Desktop.
plist to run this AppleScript every minute via launchd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.nateofnine.FlaggedMailToReminders</string>
<key>Program</key>
<string>/usr/bin/osascript</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/PATH_TO_YOUR_APPLESCRIPT/flagged_mail_to_reminders.scpt</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>
@kush-agra
Copy link

Thank You :)

@sergdenisov
Copy link

Thanks, this helped me.

Copy link

ghost commented Mar 25, 2020

Hey, I was having trouble with this script and wondered if you could help me out.

When I set this to a time in the future, it doesn't run, I loaded it with:
launchctl load /Library/LaunchAgents/local.NumbersScript.NewMonth.plist

I even tried running this but nothing happened:
launchctl start /Library/LaunchAgents/local.NumbersScript.NewMonth.plist

I ran this just fine:
osascript osascript /Users/kdhalljr/Library/Scripts/New\ Month.scpt

I even turned the apple script into an application and tried to run that under the Program key with no avail

Here is the modified script in /Library/LaunchAgents/local.NumbersScript.NewMonth.plist:

Disabled Label local.NumbersScript.NewMonth Program /usr/bin/osascript ProgramArguments osascript /Users/kdhalljr/Library/Scripts/New\ Month.scpt RunAtLoad KeepAlive StartCalendarInterval Hour 1 Minute 29

Here is the /Users/kdhalljr/Library/Scripts/New\ Month.scpt file:
tell me
activate
display dialog "Hello World"
end tell

Copy link

ghost commented Mar 27, 2020

I figured it out, no need to use \ before spaces in the string element

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment