Re: Closing app process when app is in background

67 views
Skip to first unread message

nanobrain

unread,
May 12, 2013, 9:03:46 PM5/12/13
to tas...@googlegroups.com
Create an APP Context and select FB Messenger
Your task will be 

Wait 2 Minutes
Run your kill script and check in your Run Shell IF %PACTIVE (list of active profiles) !~ (does not match) *,NameOfYourProfile,* (the stars and commas are important, see the user's guide for pattern matching and %PACTIVE)

Go back into your profile screen, long click on the task and select "Move to exit"

Profit!! (At least I hope so, this is from memory) 

On Sunday, May 12, 2013 8:45:40 AM UTC-4, Thomas M wrote:
Hey there. I've decided to try and use Tasker rather than "llama", because Tasker seems to be able to do so much more and I'd like to put all my "automatic stuff" under one application.

So yeah.. I'm new to this but not a complete noob, I guess. I'm looking for a way to, if we take Facebook Messenger for instance, to close an app's process and everything related to it, 2 minutes after I've "left" the app. So if I use Messenger then leave it, I want Tasker to kill its process after a couple of minutes BUT incase I enter the app again, this delay should be stopped along with the entire "killing" process.

It's not so much the actual killing of the process/services, I can do that with scripting, but it's more the actual * minutes delay after leaving the app in background together with the cancellation of the delay incase I enter the app again.

Any help appreciated.

Thanks!

Thomas M

unread,
May 13, 2013, 2:57:42 AM5/13/13
to tas...@googlegroups.com
Thanks alot for the reply, mate. Sounds like a good solution but I was thinking; what if I used the task killer plugin for Tasker (The "hardcore" method of killing apps seems to be what I want, and much more realiable than the script I made myself). How would I make that fit with the "Run Shell if %PACTIVE"?

and the app context shouldn't be set to "if not FB messenger", should it?

Thanks,

nanobrain

unread,
May 13, 2013, 7:30:48 AM5/13/13
to tas...@googlegroups.com
Under Task use the IF / END IF commands, they are useful for conditionally run more then one command or plugins :)

IF %PACTIVE !~ *,NameOfYourProfile,*
Run your plugin here
ENDIF

and the app context shouldn't be set to "if not FB messenger", should it?

That's why I said to put it into the exit task. The APP profile becomes active when FB Messenger is launched/comes to the foreground then the enter task launches (if any), once FB Messenger is sent to the background, the context becomes false and the exit task is launched. 

The user's guide is a good resource to explain how the contexts work.   

Thomas M

unread,
May 13, 2013, 10:25:47 AM5/13/13
to tas...@googlegroups.com
Works a charm! Thank you very much, man!
Reply all
Reply to author
Forward
0 new messages