On Monday, April 5, 2021 at 7:58:29 AM UTC-7 [email protected] 
wrote:

> is it possible to trigger , start or stop a timer automatically if a 
> certain criteria is met?  so similar to a CRM ticketing tool, creating and 
> saving a new tiddler would automatically start a timer , or maybe creating 
> a new tiddler with a specific Tag would trigger a predefined duration ?
>

Alarms are defined by creating a field named "alarms" in *any* tiddler.  
The contents of the alarms field is a space-separated list, where each 
alarm has several parts delimited by semi-colons, like this: 
type;date;time;msg, where:

*type *is a keyword: "*once*", "*daily*", or a specific day (e.g., "*Sunday*", 
"*Monday*", etc.)
*date *is specified using YYYY-0MM-0DD format (e.g. "*2021-04-05*")
*time *is specified using 0hh:0mm:0ss format (e.g., "*09:15:30*")
*msg *is the text to display when the alarm is triggered.

Note that if the type is "*daily*" or a specific day, then the date part of 
the alarm definition is left blank but the semi-colon delimiters are still 
present, so there will be two adjacent semi-colons (see example below).  
Also, if the msg text contains any spaces, then the entire alarm definition 
must be surrounded by doubled square brackets.  For example, the following 
"alarms" field content specifies four individual alarms:

[[Monday;;07:00:00;Time for another work week :(]] [[daily;;12:00:00;Lunch 
break]] [[Friday;;17:00:00;Weekend starts...  YAY!]] 
[[once;2021-01-01;00:00:00;Happy New Year!]]

For your specific use-case (i.e. adding an alarm for a given criteria), you 
would need to have a custom button that would create the desired tiddler 
and add the appropriate alarms field definition, using one or more 
$action-setfield widgets.  It might also be possible to do this whenever a 
tiddler is created via the standard "save tiddler" button from the tiddler 
editor, but this would require adding some JS code to catch the 
"th-saving-tiddler" hook 
(see https://tiddlywiki.com/dev/#Hook%3A%20th-saving-tiddler).

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e2306a28-78a1-4299-8149-7408fe3095bcn%40googlegroups.com.

Reply via email to