My app switcher won't work

83 views
Skip to first unread message

Yan Lin

unread,
Mar 20, 2015, 9:01:31 PM3/20/15
to tas...@googlegroups.com
I've made a simple task that activated by pressing my bt button to switch apps I mainly use during driving. As a test, I made these 2 apps to switch one another. Problem is if My %WIN is Waze, my tak stop and won't launch whatsapp. But when whatsapp is in %WIN position it will launch Waze. I've tried experimenting using variable set and it worked flawlessly. What did I miss? I also have another profile using %WIN as trigger. In this profile I use if there is no waze on my screen then destroy scene. Is this connected to my switch app task somehow?

Switch App (48)
A1: If [ %WIN ~ Waze ]
A2: Launch App [ App:WhatsApp Data: Exclude From Recent Apps:Off ]
A3: Else
A4: Launch App [ App:Waze Data: Exclude From Recent Apps:Off ]
A5: End If

Thanks... appreciate your help.

Rich D

unread,
Mar 21, 2015, 3:32:15 PM3/21/15
to Tasker Google Groups Post


> I've made a simple task that activated by pressing my bt button to switch apps I mainly use during driving. As a test, I made these 2 apps to switch one another. Problem is if My %WIN is Waze, my tak stop and won't launch whatsapp.

Check the run log (menu / more / runlog).  If you set a local variable to %WIN as the first action in the task you will be able to see the value of %WIN (in the log) just before the IF action.

But when whatsapp is in %WIN position it will launch Waze.

It actually looks like if %WIN matches 'anything exept'  Waze then it will launch Whatsapp.

I've tried experimenting using variable set and it worked flawlessly.

Could you explain what you did and what worked?

What did I miss? I also have another profile using %WIN as trigger. In this profile I use if there is no waze on my screen then destroy scene. Is this connected to my switch app task somehow?

Not sure, can you post that profile as well.

>

Yan Lin

unread,
Mar 22, 2015, 2:29:05 AM3/22/15
to tas...@googlegroups.com
Hello Rich D...

Here is my other profile that triggered by %WIN == WAZE

Profile: Scene Overlay Zello (50)
Priority: 4 Restore: no Enforce: no
State: Variable Value [ %WIN ~ Waze ]
Enter: Toggle (37)
A1: Show Scene [ Name:Overlays Display As:Overlay, Blocking Horizontal Position:3 Vertical Position:100 Animation:System Show Exit Button:On Continue Task Immediately:On ]
A2: Perform Task [ Name:Switch App Priority:3 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

Exit: Close Scene (40)
A1: Destroy Scene [ Name:Overlays ]
A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]

This profile works as expected. But my App Switcher above will stuck while %WIN ==WAZE.

I found another way out by adding an extra scene that will set variable %Appswitcher to 1 and then I add wait until function after if.

Switch App (44)
Abort Existing Task
A1: If [ %WIN ~ WhatsApp ]
A2: Launch App [ App:Waze Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A3: Flash [ Text:%WIN Long:Off ]
A4: Else
A5: If [ %WIN ~ Waze ]
A6: Wait Until [ MS:0 Seconds:0 Minutes:2 Hours:0 Days:0 ] If [ %Appswitch ~ 1 ]
A7: Launch App [ App:AliExpress Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A8: Flash [ Text:%WIN Long:Off ]
A9: Else
A10: If [ %WIN ~ AliExpress ]
A11: Launch App [ App:WhatsApp Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A12: Flash [ Text:%WIN Long:Off ]
A13: End If
A14: End If
A15: Variable Clear [ Name:%Appswitch Pattern Matching:Off ]

My suspicion is concerning task and profile priorities.

Yan Lin

unread,
Mar 22, 2015, 2:37:06 AM3/22/15
to tas...@googlegroups.com
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Rich D

unread,
Mar 22, 2015, 9:39:31 PM3/22/15
to Tasker Google Groups Post

> Hello Rich D...
>
> Here is my other profile that triggered by %WIN == WAZE
>
> Profile: Scene Overlay Zello (50)
>         Priority: 4 Restore: no Enforce: no
>         State: Variable Value [ %WIN ~ Waze ]
> Enter: Toggle (37)
>         A1: Show Scene [ Name:Overlays Display As:Overlay, Blocking Horizontal Position:3 Vertical Position:100 Animation:System Show Exit Button:On Continue Task Immediately:On ]
>         A2: Perform Task [ Name:Switch App Priority:3 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
>
> Exit: Close Scene (40)
>         A1: Destroy Scene [ Name:Overlays ]
>         A2: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
>
> This profile works as expected. But my App Switcher above will stuck while %WIN ==WAZE.
>

I would suspect the %WIN value is changing to the scene name when you show the scene.  You can check this as i suggested before by setting %WIN to a local variable as the first action in the task. Then check the run log to see what it was set to.

The fix would be to add the %WIN value of your scene to if action.

A1: If [ %WIN ~ Waze/Your scene Win Value ]

That will 'or' the 2 values.   

Yan Lin

unread,
Mar 27, 2015, 5:23:02 AM3/27/15
to tas...@googlegroups.com
Hello Rich D... this is my log after I run the Appswitch profile:

20150327 16.12.09 A OK ID44.2 Switch App.Secure Settings
20150327 16.12.09 A OK ID44.3 Switch App.If
20150327 16.12.09 A OK ID44.4 Switch App.Launch App
20150327 16.12.09 A OK ID44.5 Switch App.Flash
20150327 16.12.09 A OK ID44.6 Switch App.Else
20150327 16.12.09 A OK ID44.18 Switch App.Var Clear, %Appswitch=%Appswitch
20150327 16.12.09 T ExitOK ID44 Switch App
20150327 16.12.09 E Stop ID0:0.0 TaskService
20150327 16.12.10 P Active ID50 Scene Overlay Zello
20150327 16.12.10 E Start ID0:0.0 TaskService
20150327 16.12.10 T Running ID37 Toggle
20150327 16.12.10 A OK ID37.1 Toggle.Show Scene
20150327 16.12.10 T Running ID44:2 Switch App
20150327 16.12.10 A OK ID37.2 Toggle.Perform Task, Switch App
20150327 16.12.10 T ExitOK ID37 Toggle
20150327 16.12.10 A OK ID44:2.1 Switch App.Var Set, %Showapp=Waze
20150327 16.12.10 A OK ID44:2.2 Switch App.Secure Settings
20150327 16.12.10 A OK ID44:2.3 Switch App.If
20150327 16.12.10 A OK ID44:2.6 Switch App.Else
20150327 16.12.10 A OK ID44:2.7 Switch App.If
20150327 16.12.14 P Inactive ID50 Scene Overlay Zello
20150327 16.12.14 T Running ID40:3 Close Scene
20150327 16.12.14 A OK ID44:2.8 Switch App.Wait Until
20150327 16.12.14 A OK ID40:3.1 Close Scene.Destroy Scene
20150327 16.12.16 A OK ID40:3.2 Close Scene.Wait
20150327 16.12.16 T ExitOK ID40:3 Close Scene
20150327 16.12.17 A OK ID44:2.8 Switch App.Wait Until
20150327 16.12.17 P Active ID46 Processes started com.waze
20150327 16.12.17 T Running ID23:4 Toggle Gps
20150327 16.12.17 A OK ID23:4.1 Toggle Gps.Secure Settings
20150327 16.12.17 A OK ID23:4.2 Toggle Gps.Display AutoRotate
20150327 16.12.17 A OK ID23:4.3 Toggle Gps.Secure Settings
20150327 16.12.17 T ExitOK ID23:4 Toggle Gps
20150327 16.12.22 T ExitRep ID44:2 Switch App
20150327 16.12.22 T Running ID44:5 Switch App
20150327 16.12.23 A OK ID44:2.8 Switch App.Wait Until
20150327 16.12.23 A OK ID44:5.1 Switch App.Var Set, %Showapp=Recent apps
20150327 16.12.23 A OK ID44:5.2 Switch App.Secure Settings
20150327 16.12.23 A OK ID44:5.3 Switch App.If
20150327 16.12.23 A OK ID44:5.6 Switch App.Else
20150327 16.12.23 A OK ID44:5.7 Switch App.If
20150327 16.12.23 A OK ID44:5.11 Switch App.Else
20150327 16.12.23 A OK ID44:5.12 Switch App.If
20150327 16.12.23 A OK ID44:5.16 Switch App.End If
20150327 16.12.23 A OK ID44:5.17 Switch App.End If
20150327 16.12.23 A OK ID44:5.18 Switch App.Var Clear, %Appswitch=%Appswitch
20150327 16.12.23 T ExitOK ID44:5 Switch App
20150327 16.12.23 E Stop ID0:0.0 TaskService
20150327 16.12.25 E Start ID0:0.0 TaskService
20150327 16.12.25 T Running ID44 Switch App
20150327 16.12.25 A OK ID44.1 Switch App.Var Set, %Showapp=Recent apps
20150327 16.12.25 A OK ID44.2 Switch App.Secure Settings
20150327 16.12.25 A OK ID44.3 Switch App.If
20150327 16.12.25 A OK ID44.6 Switch App.Else
20150327 16.12.25 A OK ID44.7 Switch App.If
20150327 16.12.25 A OK ID44.11 Switch App.Else
20150327 16.12.25 A OK ID44.12 Switch App.If
20150327 16.12.25 A OK ID44.16 Switch App.End If
20150327 16.12.25 A OK ID44.17 Switch App.End If
20150327 16.12.25 A OK ID44.18 Switch App.Var Clear, %Appswitch=%Appswitch
20150327 16.12.25 T ExitOK ID44 Switch App
20150327 16.12.25 E Stop ID0:0.0 TaskService
20150327 16.12.30 P Active ID50 Scene Overlay Zello
20150327 16.12.30 E Start ID0:0.0 TaskService
20150327 16.12.30 T Running ID37 Toggle
20150327 16.12.30 A OK ID37.1 Toggle.Show Scene
20150327 16.12.30 T Running ID44:2 Switch App
20150327 16.12.30 A OK ID37.2 Toggle.Perform Task, Switch App
20150327 16.12.30 T ExitOK ID37 Toggle
20150327 16.12.30 A OK ID44:2.1 Switch App.Var Set, %Showapp=Waze
20150327 16.12.30 A OK ID44:2.2 Switch App.Secure Settings
20150327 16.12.30 A OK ID44:2.3 Switch App.If
20150327 16.12.30 A OK ID44:2.6 Switch App.Else
20150327 16.12.30 A OK ID44:2.7 Switch App.If
20150327 16.12.38 P Inactive ID50 Scene Overlay Zello
20150327 16.12.38 T Running ID40:3 Close Scene
20150327 16.12.38 A OK ID44:2.8 Switch App.Wait Until
20150327 16.12.38 A OK ID40:3.1 Close Scene.Destroy Scene
20150327 16.12.40 A OK ID40:3.2 Close Scene.Wait
20150327 16.12.40 T ExitOK ID40:3 Close Scene

The %Showapp that I put on the first line of my task shows Waze. But when Waze is on screen the app switcher won't work. Can you help me what's wrong with my task? Thx

Rich D

unread,
Mar 27, 2015, 6:04:24 AM3/27/15
to Tasker Google Groups Post


> 20150327 16.12.09 A OK       ID44.2   Switch App.Secure Settings
> 20150327 16.12.09 A OK       ID44.3   Switch App.If
> 20150327 16.12.09 A OK       ID44.4   Switch App.Launch App
> 20150327 16.12.09 A OK       ID44.5   Switch App.Flash
> 20150327 16.12.09 A OK       ID44.6   Switch App.Else
> 20150327 16.12.09 A OK       ID44.18  Switch App.Var Clear, %Appswitch=%Appswitch

It looks like IF action worked on this iteration of the task.






> --
> 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.
> Visit this group at http://groups.google.com/group/tasker.
> For more options, visit https://groups.google.com/d/optout.

Rich D

unread,
Mar 27, 2015, 6:06:07 AM3/27/15
to Tasker Google Groups Post


It looks like you changed some things,
Could you re-post the exported descriptions.

> 20150327 16.12.09 A OK       ID44.2   Switch App.Secure Settings

What is this action doing?

Check for extra white spaces in the "Waze" match in the if action

Try adding the same  variable set lower in the task. IE after the secure settings action and the just after the 'else'  action.

Yan Lin

unread,
Mar 27, 2015, 7:32:52 AM3/27/15
to tas...@googlegroups.com
The secure settings is used to disable keyguard. Yes, I've changed a bit to overcome my problem temporarily. So I use a switch button in the Zello Scene to manually switch app while Waze is on display.
Here is my new iteration:
Switch App (44)
Abort Existing Task
A1: Variable Set [ Name:%Showapp To:%WIN Do Maths:Off Append:Off ]
A2: Secure Settings [ Configuration:Keyguard Disabled/BG Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
A3: If [ %WIN ~ WhatsApp ]
A4: Launch App [ App:Waze Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A5: Flash [ Text:%WIN Long:Off ]
A6: Else
A7: If [ %WIN ~ Waze ]
A8: Wait Until [ MS:0 Seconds:0 Minutes:2 Hours:0 Days:0 ] If [ %Appswitch ~ 1 ]
A9: Launch App [ App:VideoReg Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A10: Flash [ Text:%WIN Long:Off ]
A11: Else
A12: If [ %WIN ~ VideoReg - tap the screen to save rescue video ]
A13: Launch App [ App:WhatsApp Data: Exclude From Recent Apps:Off Always Start New Copy:Off ]
A14: Flash [ Text:%WIN Long:Off ]
A15: End If
A16: End If
A17: End If
A18: Variable Clear [ Name:%Appswitch Pattern Matching:Off ]

Yan Lin

unread,
Mar 27, 2015, 7:35:54 AM3/27/15
to tas...@googlegroups.com
I don't understand by your statement:
"Try adding the same variable set lower in the task. IE after the secure settings action and the just after the 'else' action"

Thank you
Reply all
Reply to author
Forward
0 new messages