User Tools

Site Tools


dictionary:events:createevent

This is an old revision of the document!


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:

create event (event name, or blank and XTension will create one for you)
that (command: turnson/turnsoff/toggles/executes/dims/presets/blocks/unblocks)
unit|script (name of the unit or the script to act upon)

Optional Parameters:

to level (integer, the value for the chosen command)
in (seconds till the start time)
starts at (AppleScript date at which to start the event)
repeats every (integer value in seconds)
randomize by (integer, minutes by which to randomize the repeat interval)
with no script (perform the action, but dont run the unit scripts)
weekdays (7 character string in the form of “-MTWTF-” use dashes for days not to execute)
handler (string, name of the handler) If executing a script you can optionally specify the handler to call rather than just running the script. This value is ignored unless the event is to execute a script.

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

History:

The optional “handler” parameter was added in XTension 9.4.21

dictionary/events/createevent.1565018942.txt.gz · Last modified: 2023/02/13 14:51 (external edit)