Here’s a step-by-step tutorial of a concrete example of how to use the AutoApps Command System:
The AutoApps Command System enables the AutoApps plugins (including Join, along with some specific 3rd party apps such as Snackbar) to communicate with Tasker, as well as communicate through Tasker, in order to have these plugins tell Tasker to do something (like perform a Task), or, simply send some data into Tasker.
There are two “parts” to enabling your AutoApps Commands to function. These two parts resemble a Broadcaster, and a Receiver.
The AutoApps Commands are “Broadcast” into Tasker by whichever plugin sending the Command. You must then create an AutoApps Event Profile in Tasker to “Receive” or “listen for” your specific commands.
When that Event Profile detects any command(s) you configure it to receive – Tasker will run the Task you have linked to the Profile. That Task will also have some variables immediately available within the Task that contain data broadcast with your original Command.
An actual AutoApps Command itself can be anything you’d like! Whatever words make sense to you can be used to create your Commands. There is also a general basic syntax to be aware of whereby your pieces of data are separated by the 3 characters =:=
An example of a easy AutoApps Command would be:
This could be used to set the media volume to 10. You could attach this command to an AutoNotification button, or an AutoBubble, send it in via Join, etc.
EVENT PROFILE TO RECEIVE A COMMAND
Once you’ve decided on your exact Command words/syntax, and have put that Command into a plugin somewhere to be broadcast, you now just need to create an Event Profile to “listen” for it.
PROFILE: Event > Plugin > AutoApps Filter: Volume=:=
Below that Command Field you’ll see some Advanced Options for using Regex, etc. and you can use these as you wish. Further down though you’ll find the Variable Section and specifically the Variable Names field.
It is in this field that you’ll enter the variable names you want available in your Task. These will be the values that occur after every =:= characters, in the order they appear. So for this example – we’ll say we want two varnames
%level available in the Task, which would correlate to the “Media” and “10” in the Command.
SO WE'RE TAKING THE SPECIFIC COMMAND: Volume=:=Media=10 AND TURNING IT INTO A GENERAL SYNTAX: command=:=voltype=:=level
Therefore in the Variable Names Field enter simply “voltype,level” and this will have AutoApps automatically create the variables names
%level in the Task you link to this Profile.
And that’s it for the Profile! As you exit the AutoApps Event Config, you’ll see your custom variable names listed along with a confirmation of your Filter:
LINK A TASK TO THIS PROFILE
Now it’s time to link the Command Received Profile and it’s parameters to an actual Task. An example Task to link to the above Profile would be something like:
A1. If %voltype ~ Media A2. Media Volume: %level A3. Else If %voltype ~ Ringer A4. Ringer Volume: %level A5. End If
As you can see that Task above is checking for the
%voltype specified in the Command, and then based on that value, it will set that volume to the
%level being received through the Command Profile.
So that one Profile and one Task created above can process multiple commands at anytime like:
Volume=:=Media=:=5 Volume=:=Ringer=:=12 Volume=:=Ringer=:=2
Simply send any of those commands from any AutoApp and Tasker will set the specified volume to the specified level. To test this example – you could simply link these three Commands to three AuotNotification Buttons in a notification you create. Or send those Commands to your device containing this Profile from another device via Join or AutoRemote and remotely set your volumes from another device!
EXTRA: – Note that Tasker now has an AutoApps Command Action so that within any Task you can broadcast as command at any time. So to accomplish the above volume settings previously you’d have to use “Perform Task” with %par1/%par2/etc – now you can just use the AutoApps Command Action
This guide was gently put together by Tasker Pro over on Reddit. If you want to further discuss aspects of this command system you can do so there or contact me directly via email, Google+ community or forum!