User Tools

Site Tools


working_with_tasker

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== Overview ====== Built-in Tasker support starts with LLX 10.5b1. This support consists in * triggering Lightning actions (such as desktop navigation, script execution) from a Tasker task * triggering Tasker tasks from Lightning, through scripting ====== Running Lightning actions from a Tasker task ====== All available Lightning actions can be used. This is similar to starting a Lightning action shortcut. In Tasker, create or modify a Task, add an action, select Plugin, then select Lightning Action. Once the action has been added edit its configuration: the Lightning action menu is displayed so that you can select one. The "Run a script" Lightning action has a particular behavior when run from Tasker: it is possible to pass some data from Tasker to LLX with variable replacement. These data can be retrieved in a Lightning script using [[http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/Event.html#getData()|Event.getData()]]. For instance, if you script is <sxh javascript;> alert(LL.getEvent().getData()); </sxh> Then calling this script from Tasker with the data **%TIME** will display a dialog in Lightning with something like **11:17** ====== Starting Tasker task from Lightning, though scripting ====== Tasker can only be invoked from scripting at the moment. This is done using the TaskerIntent and ActionCodes classes and the [[http://www.pierrox.net/android/applications/lightning_launcher/script/reference/net/pierrox/lightning_launcher/script/api/LL.html#sendTaskerIntent(TaskerIntent, boolean)|LL.sendTaskerIntent() method]]. ===== Calling an existing task ===== The simplest way to call a Tasker task is: <sxh javascript;> LL.sendTaskerIntent(new TaskerIntent("MyTask"), false); </sxh> Where **MyTask** is the name of a task already defined in Tasker. ===== Requesting Tasker to execute a task on the fly ===== This method does not need to configure a task in Tasker. You can elaborate a sequence of actions and request Tasker to execute it. <sxh javascript;> var i = new TaskerIntent("Say"); i.addAction(ActionCodes.SAY); i.addArg("hello"); i.addArg("com.google.android.tts:en-gbr"); i.addArg(0); i.addArg(5); i.addArg(5); i.addArg(true); i.addArg(false); i.addArg(false); LL.sendTaskerIntent(i, true); alert("done"); </sxh> This sample will trigger speech synthesis. Arguments need to be specified according to the order found in the Tasker UI or documentation for the given action. More documentation on TaskerIntent can be found here: [[http://tasker.dinglisch.net/invoketasks.html]]

working_with_tasker.1409658340.txt.gz · Last modified: 2014/09/02 11:45 by pierrox