User Tools

Site Tools


working_with_tasker

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
working_with_tasker [2014/09/02 11:45]
pierrox created
working_with_tasker [2015/05/15 07:57]
pierrox [Overview]
Line 2: Line 2:
 Built-in Tasker support starts with LLX 10.5b1. Built-in Tasker support starts with LLX 10.5b1.
 This support consists in  This support consists in 
-  * triggering ​Lightning actions ​(such as desktop navigation, script execution) ​from a Tasker task +  * launching ​Lightning actions from a Tasker task 
-  * triggering ​Tasker tasks from Lightning, through scripting +  * launching Lightning scripts from a Tasker task 
 +  * setting variables inside Lightning from a Tasker task (starting at 12.5b1) 
 +  * launching ​Tasker tasks from Lightning, through scripting
 ====== Running Lightning actions from a Tasker task ====== ====== 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. 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 particular behavior ​when run from Taskerit 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()]].+====== Running Lightning scripts from a Tasker task ====== 
 +Starting at version 12.4b2, it is possible to directly select ​a script ​as a plugin action in Tasker. This is equivalent to selecting a Lightning action ​and then select "​Run ​script"​. In addition, ​when selecting the script, there is an option to select where to execute the script (in the desktop, in the app drawer, in the lock screen or in the background). 
 + 
 +When running a Lightning script ​from Tasker it is possible to pass data to Lightning ​with variable replacement. These data can be retrieved in the 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  For instance, if you script is 
 <sxh javascript;>​ <sxh javascript;>​
Line 17: Line 21:
 ====== Starting Tasker task from Lightning, though scripting ====== ====== 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]]. 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]].
 +
 +====== Important notes on background scripts ======
 +Scripts run in the background are executed in a special context. Since there is no UI, not all features are available. For instance it is not possible to get the cell size of a container since it is not displayed, nor it is possible to get the list of open folders. Keep in mind that scripts in background are not executed for the desktop, the app drawer or the lock screen, but "​outside",​ without a screen. It is allowed to change items and container properties, but not to navigate into a desktop or open a folder.
 +
 +The API documentation mentions cases where a given method is not supported in background mode.
 +
 +When a script is run in the background, the Lightning Launcher app may be started by the Android system (it will remain invisible), and it may be stopped after a while. As a consequence changes made to items that are not persistent will be lost.
  
 ===== Calling an existing task ===== ===== Calling an existing task =====
working_with_tasker.txt · Last modified: 2015/05/15 08:06 by pierrox