Checkbox Elements in Scenes/Set Element Value

547 views
Skip to first unread message

Joshua Watson

unread,
Mar 5, 2014, 6:00:54 PM3/5/14
to tas...@googlegroups.com
G'day,

It seems to me that no matter how I use the Element Value function, I can't get a scene to launch with a checkbox already checked. I tried on/off or 0/1 and the value doesn't hold. I set a variable (via Variable Set function, I called it %WTH) to the value of %new_val just to see what Tasker was putting out, and sure enough, it uses on/off. Using static values or values stored in a variable will not change how the scene shows up. I can get the same functionality with a text box that changes conditionally based on what the variable flag is, but I rather like checkboxes.

Am I missing something here?

  Zedii

Joshua Watson

unread,
Mar 5, 2014, 6:07:29 PM3/5/14
to tas...@googlegroups.com
Does this have something to do with the "checked" option in the options for the element in the scene editor? The whole idea is to show a scene with a checkbox checked if the flag is 1/on and unchecked if the flag is 0/off. It seems the Element Value function, which works well for sliders, doesn't work in this situation. I think that is more clear than the last attempt. =) Thanks.

Bob Hansen

unread,
Mar 5, 2014, 6:09:52 PM3/5/14
to tas...@googlegroups.com
You need to first create the scene then set the element value and finally show the scene.

Joshua Watson

unread,
Mar 6, 2014, 8:28:50 AM3/6/14
to tas...@googlegroups.com

Thanks for your help, Bob.

I thought I needed to create a scene first, but I can't get the scene to show when I do it that way. Here is an idea of what I'm doing

Prep Main (30)
Abort Existing Task
A2: Create Scene [ Name:Main ]
A3: Element Value [ Scene Name:Main Element:Spinner1 Value:%MYCALLABEL ]
A4: Element Value [ Scene Name:Main Element:Note Permanent Check Value:%PERMNOT ]
A5: Element Value [ Scene Name:Main Element:Use All Cal Value:%ALLCAL ]
A6: Perform Task [ Name:Launch Main Stop:Off Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]

The scene doesn't show in this task. It doesn't show unless I manually show the scene in a separate task after creating the scene and setting the element values. I'm probably missing something here.

Bob Hansen

unread,
Mar 6, 2014, 8:32:04 AM3/6/14
to tas...@googlegroups.com
Use the Show Scene action not Perform Task.

Joshua Watson

unread,
Mar 6, 2014, 8:56:56 AM3/6/14
to tas...@googlegroups.com

The perform task links to a show scene action. I've tried using show scene directly the task. The scene doesn't show either way if the show scene is part of the same task that the set element value part is.

I'm using the most recent tasker beta. I'll try in the mainstream version and see if that makes a difference.

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/HuX8zjPX0RQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.

Rich D

unread,
Mar 6, 2014, 9:55:27 AM3/6/14
to Tasker Google Groups Post


> The perform task links to a show scene action. I've tried using show scene directly the task. The scene doesn't show either way if the show scene is part of the same task that the set element value part is.

Sounds a bit strange.. what does the run log show when you try to show the scene form within the task?

You can turn on 'pop up errors /warnings' in menu /preferences / misc.  To see if it throwing a error on the show scene. The error will show when you reopen the Tasker UI.

You could also try a 'hide scene' just before the 'show scene' ... this of course would indicate some type of a bug.

>

Joshua Watson

unread,
Mar 6, 2014, 1:57:57 PM3/6/14
to tas...@googlegroups.com

Done a little debugging on this,

06-03-2014 Expr: 11.41.53#Expr: warning: mathEval: All System Calendars: exception: Unrecognized variable or constant "AllSystemCalendars" at offset 0 in expression "AllSystemCalendars"

06-03-2014 ActionArgInt: 11.41.53#ActionArgInt: warning: variable %MYCALLABEL non-numeric: All System Calendars

06-03-2014 E: 11.41.53#E: warning: var %MYCALLABEL: non-numeric or extreme value

06-03-2014 E: 11.41.53#E: result: stop task (error)

06-03-2014 E: 11.41.53#E: remove finished task from q: Prep Main

The shoes fine if the show scene task is not in the same task as the create or set element value tasks.

I've attached a log of this very simple action, which does nothing as far as i can see.

Due(50)
A1: Create Scene [ Name:Main ]
A2: Element Value [ Scene Name:Main Element:Use All Cal Value:%ALLCAL ]
A3: Show Scene [ Name:Main Display As:Activity, Full Display Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:Off Continue Task Immediately:On ]

log.txt

Joshua Watson

unread,
Mar 6, 2014, 1:59:13 PM3/6/14
to tas...@googlegroups.com

The point if the first part in the last post was to ask if a static text element value could cause that problem. It doesn't launch when the element is removed either though.

Joshua Watson

unread,
Mar 6, 2014, 3:06:42 PM3/6/14
to tas...@googlegroups.com

I figured out the problem after making a test scene.

Tasker stores values of on/off for the value of a checkbox using the new_val or old_val variable. Show scene stops when non numeric variables are involved. So I used 1-%VAR with a conditional to switch the value. That works. The other problem was that I forgot to destroy the scene on exit, and creating a scene that is already created results in an error.

Thanks for your help, Bob. No need to dig through those logs. =)

Joshua Watson

unread,
Mar 6, 2014, 3:35:20 PM3/6/14
to tas...@googlegroups.com

Next question:
What is tasker looking for when setting an element value for a spinner? I have tried using tap_index and tap_label, and both ways lead to an error.

Rich D

unread,
Mar 6, 2014, 5:25:46 PM3/6/14
to Tasker Google Groups Post


> Next question:
> What is tasker looking for

Not sure what you mean by 'looking for'

when setting an element value for a spinner?

Setting it how?

I have tried using tap_index and tap_label, and both ways lead to an error.

You mean %tap_index and %tap_label correct?

Those are the variables that get set when a "new" item is selected..

How are trying to use those variables???



>
> --
> You received this message because you are subscribed to the Google Groups "Tasker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.

Handy Trisakti

unread,
Mar 7, 2014, 3:08:54 AM3/7/14
to tas...@googlegroups.com
I got my spinner working:
Save tap_index to global var
Create scene and set spinner1 to global var..

I also found that create scene is error if I have uninitialized variables.
So I run tasks to set all of them if unset

Joshua Watson

unread,
Mar 7, 2014, 1:51:48 PM3/7/14
to tas...@googlegroups.com
Good tip. To reply and also answer Bob's questions:

I've tried using a global variable (we'll call it %SPINDEX) set to %tap_index from the selection at the spinner. The task creates the scene, sets the element value for the spinner to %SPINDEX (or initializes %SPINDEX to 0 if it hasn't been initialized yet), and shows the scene. The error shows up like this - #SEHI:warning: select: bad index: 8, only 0 items. %SPINDEX:non-numeric or extreme value. The value of %SPINDEX is 8 and the spinner should include index values 0-9 because it has nine entries.

I think the problem might that my spinner gets its values from a variable array that is refreshed as part of the task that launches the scene where the spinner is. The problem is that even though the spinner has 9 entries, the system thinks the spinner has 0 entries. If I initialize a spinner without a variable array, this problem doesn't occur.


--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/HuX8zjPX0RQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages