java - Sl4a run Tasker Task and pass variable -
i try start tasker task sl4a , passing variable %par1.
i have found solution here: https://groups.google.com/forum/#!starred/tasker/ayw-lhctqwg
it run task "test" variable %par1 isn't passed. here script:
import android droid = android.android() task_name = 'test' par1 = 'test variable' extras = {'task_name': task_name, '%par1': par1} taskintent = droid.makeintent('net.dinglisch.android.tasker.action_task', none, none, extras).result droid.sendbroadcastintent(taskintent)
the developer "pent" has answered tip:
extras = {'task_name': task_name} extras['varnames'] = namelist extras['varvalues'] = valuelist
i don't know python, looks array rather array list (array list java dynamic array).
so try change extras to:
... task_name = 'test' varvalues = 'test variable' varnames = '%par' extras = {} extras['task_name'] = task_name extras['varnames'] = varnames extras['varvalues'] = varvalues ...
now same task "test" start don't passed.
the task make toast of %par1.
here script far:
import android droid = android.android() task_name = 'test' varvalues = 'test variable' varnames = '%par' extras = {} extras['task_name'] = task_name extras['varnames'] = varnames extras['varvalues'] = varvalues taskintent = droid.makeintent('net.dinglisch.android.tasker.action_task', none, none, extras).result droid.sendbroadcastintent(taskintent)
how make java dynamic array list pass variables tasker?
i'd save qpython variable file , read file tasker tasker's variable.
Comments
Post a Comment