Check if an app is currently running?

4,297 views
Skip to first unread message

Jeraldine Walter

unread,
Sep 19, 2013, 10:49:45 AM9/19/13
to tas...@googlegroups.com
Hi,

the wiki says:
Tasks Running (dynamic)
%TRUN
A comma-separated list of any named tasks which are currently running. The list always starts and ends with a comma to make matching easier, if it's not empty.

I want to check if an application is currenty running.
In this case it's "Blitzer.de PLUS"

If the documentation is correct, a list of all running apps should look like this:
,<app a>,<app b>,Blitzer.de PLUS, <app d>, etc.,

A little script:
If
%TRUN ~ *blitzer*
Vibrate
Time 200
End If

Blitzer.de PLUS is currently running, Tasker is in the foreground and the details of this task aktive.

But whenever I press the little play button in the lower left corner, the phone doesn't vibrate -> Which means: app was not found.

I've tried regex matching patterns as well.
E.g.:
%TRUN ~R .*blitzer.*

But regardless of what I'm trying nothing seems to match...

What am I doing wrong?

Tasker 4.1u3
Samsung Galaxy S1+
Cyanogen Mod 10.1 (4.2.2 Jellybean)

Regards,
Jeraldine


nanobrain

unread,
Sep 19, 2013, 11:00:26 AM9/19/13
to tas...@googlegroups.com
Your misunderstanding is that %TRUN contains the currently running TASKER named tasks, NOT a list of currently running applications. You can create a profile with an application context in Tasker that becomes valid if the application of your choice is in the foreground, but it will become inactive if you switch away from your application and it drops into the background. There are several discussions in the forum how to detect background processes, none of which are especially easy to implement. 

Jeraldine Walter

unread,
Sep 19, 2013, 11:20:47 AM9/19/13
to tas...@googlegroups.com
Thank you nanobrain!

I'll probably have to switch to the most easiest way by inserting a normal wait command after starting Blitzer.de PLUS.
My main goal was to start a second application directly after the first (Blitzer...) one became the current foreground app... but a profile won't help me in this case ;)

nanobrain

unread,
Sep 19, 2013, 4:05:37 PM9/19/13
to tas...@googlegroups.com
Well, if that's all you want to do you could create a profile with an application context with Blitzer.de Plus and in the enter task put a App >> Load App with your second application. But in that case your second app would become active every time you invoked Blitzer.de Plus.

Better to just drive slower ;)

Khaos

unread,
Apr 18, 2014, 8:16:42 AM4/18/14
to tas...@googlegroups.com
Hi,

this extension could help you ;)


Regards

Khaos

Ian Richardson

unread,
Apr 18, 2014, 10:49:39 PM4/18/14
to tas...@googlegroups.com
Thanks, Khaos! I just installed and am grateful for your awesome update to our awesome tasker for a much needed function.
Reply all
Reply to author
Forward
0 new messages