Kill Current App (77)
A1: Run Shell [ Command:dumpsys window windows | grep -E 'mCurrentFocus' Timeout (Seconds):0 Use Root:On Store Output In:%RawDump Store Errors In: Store Result In: Continue Task After Error:On ]
A2: Variable Search Replace [ Variable:%RawDump Search:\S+\. Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%RawDump Replace Matches:Off Replace With: ]
A3: Variable Split [ Name:%RawDump1 Splitter:/ Delete Base:Off ]
A4: Variable Set [ Name:%CURRENTAPP To:%RawDump11 Do Maths:Off Append:Off ]
A5: If [ %CURRENTAPP !~ com.sec.android.app.launcher ]
A6: If [ %CURRENTAPP !~ com.teslacoilsw.launcher ]
A7: If [ %CURRENTAPP !~ com.tsf.shell ]
A8: Run Shell [ Command:am force-stop %CURRENTAPP Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: Continue Task After Error:On ]
A9: Flash [ Text:%CURRENTAPP killed Long:Off ]
A10: End If
A11: End If
A12: End If
A13: Stop [ With Error:Off Task: ]
So, what I posted was the exported description of a task. Each Action in the task is marked with "A1" etc... and everything in the brackets describes how to setup that individual Action.
So, for example:
A1: Run Shell [ Command:dumpsys window windows | grep -E 'mCurrentFocus' Timeout (Seconds):0 Use Root:On Store Output In:%RawDump Store Errors In: Store Result In: Continue Task After Error:On ]
You would start a task, add the Run Shell action (Code > Run Shell) and in the Command line you would put "dumpsys window windows | grep -E 'mCurrentFocus'" (without those double quotes). And you'd check the box next to Use Root, enter the variable name "%RawDump" in the Store Output In field. Check the box next to Continue Task After Error.
Then proceed with seeing up the second action, and so forth.
You're correct, I have 3 launchers that could potentially be in use...TouchWiz, Nova, and TSF 3D...I check to make sure they're not %CURRENTAPP (which means they'd be in the foreground) because the script in A8 will kill the launcher if you let it.
--
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/oqnFjvB_Mck/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.