HOW TO: Trigger an AppleScript at specific date and time

A lot of our applications are AppleScriptable. Which means that they can be controlled by AppleScripts. This brings a lot of flexibility to the software.

For example you could trigger an AppleScript automatically using the Calendar application to perform actions at specific date and time. Note that if the application you are using has a scheduling feature (such as MovieRecorder or OnTheAir Video), you should rather use it and not this method.

 

Create the AppleScript

The easies is probably to start with a sample script. When installing some of our applications you are given the choice to install some AppleScript samples:

OTASW_Installer_SampleScripts.png

These AppleScripts will be installed in the same folder as the Application:

OTASW_AppFolder.png

Double click to open it, verify it and edit it so it does what you need it to do (we are not covering that part here), and then choose the menu "File  > Export...", and in the window that pops up, select where you want to export the file, and for the File Format, make sure to select "Application":

AppleScript_Export.png

This is not mandatory, and you could use simple scripts but that proves to be more reliable when it is saved as an Application. You could also enable the "Run-only" checkbox if you don't want the application AppleScript to be editable.

 

Create an alert for a reminder in Calendar

Then, in the macOS Calendar application, create an event, and in the "alert" section choose "Custom":

Calendar_01_CustomAlert.png

Then in the first popup menu, choose "Open file":

Calendar_02_OpenFile.png

In the second popup menu, choose "Other..."

Calendar_03_Other.png

Then select the AppleScript you want to execute:

Calendar_04_SelectApp.png

And maybe set when you want the event to be triggered:

Calendar_05_Completed.png

This is how your event will look like once completed:

Calendar_06_AllDone.png

 

Have more questions? Submit a request

Comments