Previously I showed you a way you can pass unlimited and complex paramters between tasks.
That's fine, but sometimes you just want to send 3 or 4 values between tasks and the JSON Write approach might be a bit overkill.
In these situations you can use AutoTools Text to help you out. It won't be as robust as the other solution because the calling task needs to know in which order to pass the parameters, but it'll be very cool for quick multiple value passing.
To learn more about setting multiple variables with AutoTools Text click here.
STEP 1 - CREATE TASK THAT RECEIVES MULTIPLE PARAMETERS
This task will receive an owner's first and last name and a list of cars all through Parameter 1 (%par1)
- Create a new Task and call it Owner And Cars.
- Add an AutoTools Text action
- Set the Text field to %par1
- Set the Variable Name field to firstname,lastname,brands()
- Go back to Tasker and add a Flash action with the textCode (Text):
Owner is %firstname %lastname
He owns these cars: %brands()
- Exit Tasker to save the task
STEP 2 - TEST CALLING THE TASK WITH MULTIPLE PARAMETERS
- Create a new Task
- Add a Perform Task action and call the Owner And Cars task there
- Set Parameter 1 to João,Dias,Tesla,Ferrari,Renault
- Run the task and notice how the flash action shows up correctly!
Tasker Pro over on Google+ came up with an additional solution for the problem:
The best way I've found to pass multiple individual variables and values between Tasks using AutoTools is to simply put the values in %par1 on the sending end, and if desired, the variable names in %par2 also on the sending end.
Then on the receiving end, use AutoTools Text with the Text set to %par1 and the Variable Names field set to %par2. Example:
A1. <Set a bunch of variables here like %year %color etc>
A2. Perform Task: "Task B"
A1. AutoTools Text:
Variable Names: %par2
This way there's no need to hardcode the varnames on the receiving end. Whatever they're sent as is whatever they're received as in regards to both name and value in the receiving Task.
Passing many values between tasks - Lazy Edition
Learn how you can use AutoTools Text to help you pass values from one Task to another