Table of Contents

Create Event

This verb creates a new scheduled event with the explicit start time and repeat period. You can turn on/off, dim or toggle a unit, execute a script or speak a phrase. You can even randomize the event and choose the weekdays.

Usage:

Optional Parameters:

Examples:

create event "Morning Coffee" that turnson unit "Coffee Pot" starts at (date) repeats every 1 * days weekdays "-MTWTF-"
create event "Evening Tea" that turnson unit "tea pot" starts at ((sunset for the (current date)) - 20 * minutes) weekdays "-MTWTF-"
create event "nightly" that executes script "going to bed" in 15 * minutes
Passing Parameters To A Handler Example

if you had a global script named “meal manager” with a handler named “mealLogger” like this:

on mealLogger( theName, theEvent)
    write log theName & “ has had “ & theMeal
end doThing

and then created an event such as this:

create event “breakfast” that executes script “meal manager” handler “mealLogger" parameter {“Jamie”, “Breakfast”} in 10 * minutes

in 10 minutes you would see output in the log like:

jamie has had breakfast

History:

The optional “handler” parameter was added in XTension 9.4.21