Pass Parameter to a Task from Profile

3,498 views
Skip to first unread message

norbert6

unread,
Aug 7, 2013, 12:30:09 PM8/7/13
to tas...@googlegroups.com
Hey there

First of all I want to mention how much I love this app.
But I have a feture request, which would make me even happier with Tasker ;)
Wouldn't it be great to be able to pass paramters to a Task when it is called by a Profile?
I have several Profiles which could call the same Task, just with a changed parameter. But curently I have to create one Task for each and every Profile, all just calling then the same Task. In my oppinion it is quit redundant.

PS: I searched for this topic and wasn't able to find it, but if it was allready mentioned I'm very sorry

Wes Stacey

unread,
Aug 7, 2013, 12:46:51 PM8/7/13
to tas...@googlegroups.com
So your saying you currently have to do is this:

Profile 1
  Enter Task: Profile 1 task
    Perform Task: Main Task Parameters: a, b, c

Profile 2
  Enter Task: Profile 2 Task
    Perform Task: Main Task Parameters: d,e


and what you would like to be able to do is this:

Profile 1
  Enter Task:  Main Task (parameter: a,b,c)

Profile 2
   Enter Task: Main Task (parameter: d,e)

Is this what you are talking about?

If i understand correctly, yes it would be nice to have that ability

-Wes

SunKol

unread,
Aug 7, 2013, 12:59:29 PM8/7/13
to tas...@googlegroups.com
How about using a %VARIABLE 

Few Profiles will keep changing the Value
Few Profile will act base on the Value. (EVENT>Variables>Variable Set) 

Sunil

Don I

unread,
Aug 7, 2013, 1:41:18 PM8/7/13
to tas...@googlegroups.com
Parent Task will call Sub Task passing the word test as Parameter.

Parent Task (130)
A1: Perform Task [ Name:Sub Task Stop:Off Priority:5 Parameter 1 (%par1):test Parameter 2 (%par2): Return Value Variable: ]

Sub Task (103)
A1: Notify [ Title:Sub Task: %par1 Text: Icon:null Number:0 Permanent:Off Priority:3 ]

norbert6

unread,
Aug 7, 2013, 2:09:18 PM8/7/13
to tas...@googlegroups.com

Thats exacly what I want Wes.
with this I don't have to create 'caller tasks' without any function than to pass a parameter to my main task.
This seems to be Dons idea, and this is what I am currently doing. It works, but I thought their is room for a better solution

Don I

unread,
Aug 7, 2013, 2:17:22 PM8/7/13
to tas...@googlegroups.com
Your profiles can call the sub task directly. You don't need to create "caller tasks". Do a search for anonymous tasks.

With this, you can 2 or more profiles calling the same sub task and all passing different parameters.

norbert6

unread,
Aug 7, 2013, 2:56:24 PM8/7/13
to tas...@googlegroups.com
ah okay, that is someting interesting
I think this is what I will going with, thank you :)

Janne Kokkonen

unread,
Dec 12, 2013, 2:19:26 AM12/12/13
to tas...@googlegroups.com

Little example or link, please. Just searched this one and always coming to same answer, seach anonymous tasks.

Not helping at all.

Pent

unread,
Dec 12, 2013, 2:56:34 AM12/12/13
to tas...@googlegroups.com
Profile: FirstProfile
Context: Time, 13.00
Task: Perform Task, SubTask, %par1 = FirstProfile

Profile: SecondProfile
Context: App, Calculator
Task: Perform Task, SubTask, %par1 = SecondProfile

Task: SubTask
Flash: Called from %par1

Pent
Message has been deleted
Message has been deleted

kokki

unread,
Dec 12, 2013, 4:01:55 AM12/12/13
to tas...@googlegroups.com
Can I do that from the UI? I didn't find correct elements to press or .. maybe I will try from text editor.

Pent

unread,
Dec 12, 2013, 5:29:23 AM12/12/13
to tas...@googlegroups.com
>Can I do that from the UI?

Of course.


> I didn't find correct elements to press or .. maybe I will try from text editor.

What's missing ?

Pent

GreenRaccoon GreenRaccoon

unread,
Jun 28, 2015, 9:34:29 PM6/28/15
to tas...@googlegroups.com
(I know this is an old thread, but it's the only one about this topic I can find on Google, so I'm necro-bumping it.)

What Don I and Pent were saying is actually really simple, but it's also really easy to miss. I've been using Tasker for years and haven't noticed it until now.

Basically, Tasker has a way for you to make a quick and simple task "on the fly" for a profile (and for that profile ONLY). It's called an "anonymous task."

When you create a profile, it asks you to select a task for it. To create an "anonymous task," first select "New Task." It'll ask for a name for the new task, but if you look closely, it says "Optional." If you leave the name blank when you press the ✔, it will create an "anonymous task."

Then, when the task screen pops up, press the "+" sign > "Task" > "Perform Task". From there, you can call another task and pass parameters to it.

Dimaz Chandra

unread,
Sep 1, 2015, 12:21:07 PM9/1/15
to Tasker
@Green Raccoon: Thanx for the steps, that's really helped.. I also wanna ask is it possible to pass parameter to a Task from Tasker shortcut or widget?

Juergen Gruen

unread,
Sep 1, 2015, 4:03:33 PM9/1/15
to Tasker
If you only want to distinguish whether your task was called by a widget or by a profile, you can check the local variable %caller.

See the user guide for more information:

http://tasker.dinglisch.net/userguide/en/variables.html

Juergen.

Dimaz Chandra

unread,
Sep 2, 2015, 12:21:11 PM9/2/15
to Tasker
Thanks for the reference, but that's not what I'm looking for. My aim is to send parameter directly from a shortcut to a task (with several functions) to call a specific function, which I assume is not possible.

So probably the best way is to just create a shortcut to a scene and then send the parameters manually from the buttons created there.

Rich D

unread,
Sep 2, 2015, 8:33:33 PM9/2/15
to Tasker Google Groups Post


> Thanks for the reference, but that's not what I'm looking for. My aim is to send parameter directly from a shortcut to a task (with several functions) to call a specific function, which I assume is not possible.
>

Could you give a example of what you are trying to do?

Dimaz Chandra

unread,
Sep 3, 2015, 2:25:29 AM9/3/15
to Tasker
So, instead of just call out the task from Tasker shortcut created on Home launcher, I want to know if it's possible to also send a parameter to the task from that shortcut (I know that we can send parameter from other task, scene, or profile).

Let's say we have three Tasker shortcuts on Home launcher to change ringer-mode: Ringer, Vibrate and Silent, each with its own task (which kind of redundant). If we can send a parameter from Tasker shortcut, then we can just merge them into one task, create three shortcuts from that same task, and call each ringer type based on its distinct parameter.

Task: SetRinger
IF %par1 ~ ringer THEN ...
IF %par1 ~ vibrate THEN ...
IF %par1 ~ silent THEN ...

Is that possible? If not, then I just gonna use a scene for this kind of purpose. Thanks!

Juergen Gruen

unread,
Sep 3, 2015, 5:33:38 AM9/3/15
to Tasker
That is not possible, I think.

I use only one widget and switch the three modes in one task.

If %SILENT~ on
    Set Variable %RingerMode = Ringer
    Set Widget Icon ...

Else If %SILENT~ off
    Set Silent Mode = Vibrate
    Set Widget Icon ...

Else If %SILENT~ vibrate
    Set Silent Mode = On
    Set Widget Icon ...

Juergen.

easiuser

unread,
Sep 3, 2015, 9:25:28 AM9/3/15
to Tasker
If you want to get rid of redunancy, simply create three tasks with only statement each.
Perform Task MainTask with %par1 ringer
Perform Task MainTask with %par1 vibrate
Perform Task MainTask with %par1 silent
 
Create three shortcuts to these three tasks.  These tasks can have different icons and names representing their function.
 
MainTask can have all your logic and a all three shortcuts will use the same code.
 
With the scene method you will have to click twice (shortcut and then scene button) and probably end up doing something very similar to the above for each scene button.

Dimaz Chandra

unread,
Sep 3, 2015, 4:57:51 PM9/3/15
to Tasker
@Juergen Gruen: I see, so you switch to the next function based on the current state. That ringer-mode switcher is just an example that closely resembles what I'm trying to do; but I need direct control, so unfortunately I can't use this setup.

@easiuser: I was thinking about using that method before, but it makes it even more redundant with separate caller tasks and additional main task. What I meant by redundant isn't about using similar functions on different tasks, but more about too many tasks used for related purpose.

Now I just created a scene to send the parameters that I can call anywhere using buttons combo with Xposed Additions, which actually works better for some stuff than using shortcuts on Home launcher.

Thank you all for your time answering the questions! Cheers and have a great day!
Reply all
Reply to author
Forward
0 new messages