This app was mentioned in 44 comments, with an average of 1.73 upvotes
Fairly straightforward actually.
You just need a plugin called KC Process Running. It can be used as a State in a Profile, or run as a query from a Task Action.
In this case you'd set it up a State Profile, pick your app(s), then choose Invert, which means it will trigger when app/process is NOT running, etc. and then you can use it to restart the app. I use it for Spotify actually in this exact manner.
In its config screen just remember to check the check mark and then use the back button to back out of it (for some reason just checking the checkmark doesn't automatically back out of the config).
There's a plugin named KC Tasker Processes which has a Profile to detect when a app is running or not running. (Use the Invert checkbox for checking when it's closed).
You can also set the interval at which the Profile will be checking for that app to be closed, etc. Seems to work very well, I use it for quite a few Profiles/Tasks.
You can use the plugin Tasker Process Running (KC), which is free. One way (the first that came to mind, there might be better ones) is:
KC Process running you'll want to get that plugin. Then use it to select a certain process for a profile to trigger the task.
I've included a working task below, however you'll need root to be rooted. The secure settings plugin is also needed.
Profile: Calculator Open Close FB (7) State: Processes started [ Configuration:com.android.calculator2 ] Enter: WorkTime (30) A1: Flash [ Text:Work Time Dude Long:Off ] A2: Secure Settings [ Configuration:Tinfoil for Facebook Disabled [User] Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
Exit: PlayTime (31) A1: Flash [ Text:As you were. Long:Off ] A2: Secure Settings [ Configuration:Tinfoil for Facebook Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
This actually disables the app when the calculator is open, and reenables it when the calculator is closed through an exit task.
I have researched about this for a couple of days and this is what I found. If you have root then you can use some terminal command to find out but without root, plugin is the only option I found. Here's the plugin https://play.google.com/store/apps/details?id=org.kc.tasker.processes&hl=en
Other non reliable method is to pull up your recent apps, using autoinput run a UI query, see if the variable %aitext() has the word pandora. This will check if pandora is in your recent apps or not. second thought, this might actually work pretty well.
Not very easily, that I know of.
This is not an answer to the question.. but it should be safe to leave GPS on all the time, unless you have a misbehaving app.
You could try this plugin to check if apps are running: https://play.google.com/store/apps/details?id=org.kc.tasker.processes
This is possible, although the couple apps you want to open would still briefly come to the foreground. You would use a plugin called <strong>KC Processes Started</strong> to test if those couple apps are running the background already, and if not - open them, then return to the main app.
So let's say you want "Chrome" and "Calculator" to open everytime you launch Gmail. Profile/Task would look like:
PROFILE: Application > Gmail
TASK: A1. KC Process Started Apps: Chrome,Calculator All Apps Must Be Running: yes Output Variable: %apps_running
A2. If %apps_running ~ false
A3. Launch App > Chrome
A4. Launch App > Calculator
A5. Launch App > Gmail
A6. End If
And in A5 it will return you to Gmail, however the Profile/Task will not run again because those apps are now running in the background. If you wanted to get more specific you could test for each app individually and only launch the one(s) that are not running.
EDIT: You may need to insert a 1-Second Wait before launching each app launch, to give Tasker time to launch each app and make sure they all open.
> If you used an App context profile instead, it could yield an infinite loop
Could put a Cooldown Time in the Profile's Settings. Better solution would be to use <strong>KC Tasker Processes</strong> plugin to see if any (or all) of the other apps are running in the background, and only launch the apps not open, or have Tasker open none at all.
The 'Application' Profile Context only triggers when the app is in the foreground.
(If you want something to detect an app running in the background, you can use the <strong>KC Tasker Processes</strong> plugin.)
Got it!
Because tasker only checks foreground apps you have to trigger it based on processes instead. Use this plugin as the trigger for the profile.
https://play.google.com/store/apps/details?id=org.kc.tasker.processes
Edit1: encountered a few unexpected auto rotation state changes. Guess some other apps might run the gallery process.
Edit2: using this process trigger along with a foreground app check of keep,gmail,etc. did increase reliability.
Just use this plugin KC Tasker Processes
Can be used in Actions for various things but also in a Profile for this purpose.
Setup Profile>State>KC Plugin>Config (then pick your app or apps, in this case Spotify, how often it should check, and whatever other options), back out of the config, and then click the Invert checkbox.
Basically meaning that the linked Task should run whenever the app you're checking for is NOT running (specifically in the background). Just link it to your volume down Task etc.
I'm using a Moto X with CM 12.1 and livedisplay causes the camera to crash (frozen viewfinder) so I was looking for a way to toggle settings in tasker and found this thread. After reading jtbird21 say that the system setting names are listed in secure settings I checked it out. Secure settings is still not updated to fully support 5.0+ and it can't change the values itself. Instead I just used shell commands in tasker after reading the setting names and values from secure settings.
In the OP's case, you'd either want to change the livedisplay mode or the color temperature of day and/or night at specific times in tasker. In my case, I had to use this plugin to detect if a camera process is running and make a task that loops until it is no longer running, starting from a profile triggered when any camera app is started, to toggle on and off my livedisplay settings.
To change display mode (Auto=2, Off=0, Day=4, Night=1):
settings put system display_temperature_mode 2
To change color temperature:
settings put system display_temperature_day 6500
settings put system display_temperature_night 3400
To change color calibration (check secure settings for currently set values, default is 1.0 1.0 1.0):
settings put system display_color_adjustment "0.8991 0.8689 1.0"
Make sure "Use Root" is also checked.
The title of your app talks about the foreground, but in your post it talks about opening an app, then exiting an app. Exiting an app means closing it from the 'X' in the recent apps screen, or force stopping it.
Switching back and forth to the app from other apps is NOT 'closing' it, it's simply switching it from foreground to background, background to foreground, etc. etc.
Two things/ways:
So if you want to toggle bluetooth on when you can SEE the app, and off when you CAN'T SEE it (foreground/background) - set up a Profile>Application>Your App then an Enter Task to turn Bluetooth on, and Exit Task to turn it off, or just one single Task that uses 'Toggle'.
OR ALTERNATELY:
If you want to turn Bluetooth On when you OPEN an app, and then Bluetooth Off when you CLOSE it (not just switch to some other app, but fully close it / stop it) - you need a plugin called Tasker Process Running, to test whether the app is running at all anywhere, and when it's not, you call your Task to turn off Bluetooth.
In this case you'd use one Profile to turn Bluetooth On on opening an app Profile>Application>Your App and trigger your Bluetooth On Task. Then to detect the app's complete closing you'd use Profile>State>Plugin>KC Tasker Process>Config then choose "Invert" (to detect the app's been fully closed) and then use the Config screen to choose your app, which would be same app as in your open Profile, but this time you link this Profile to your Bluetooth "off" Task.
Use the "Tasker Process Running (KC)" plugin to detect apps running even without being in the foreground. It also detects apps truly closing (not in the background).
https://play.google.com/store/apps/details?id=org.kc.tasker.processes
If you are using a menu to show a list of media players, go into the rule and check the box in front of the media player icon you wish it to default too. There is an option in that screen for time before it selects the default.
Probably this could be done with a rule that sees if an app is running and ignores rule 1. Maybe with a variable that changes from 0 to 1 if a media app is running.
Maybe this will help. https://play.google.com/store/apps/details?id=org.kc.tasker.processes&hl=en
As /u/Hayes mentioned, that Profile will be triggered when the chosen app(s) have first been entered then exited.
As far as finding out if a certain app is running in general (whether foreground or background) you can use the <strong>KC Tasker Processes</strong> plugin.
There is a plugin called <strong>KC Tasker Processes</strong> that let's you setup a profile that reacts to when an app's processes are running.
Chexk that out and see if it works for you.
For foreground check can you always use <strong>AutoInput</strong> and the UI Query action. %aiapp
will contain Chrome
if it's in foreground.
Background is trickier. Have you tried using the <strong>Tasker Process Running</strong> plugin? Don't know if it works for Chrome though.
You could also make a Profile that populates a variable when you launch Chrome:
Profile Application => Chrome
Task A1. Variable set %Chrome_status To 1
Exit Task A1. Variable set %Chrome_status To 0
The is a plugin for Tasker named "<strong>KC Process Running</strong>" that can solve this issue.
It basically checks to see if an app is running, in the foreground or background. So you can have it be the first action in your Task to check if the keypass app is running. If it is, stop the Task, else have the Task proceed to launch the keypass app.
The only thing you would have to do at some point when you're done with the banking app is to close the keypass app as well.
You can try Tasker Process Running to check if your home banking app or any process associated with it is running. The setup is pretty straightforward.
Using Tasker Process Running I am trying to set up a task that will recognize if this particular app is running and if not, start said task of adding Xmin to the timesheet. If so, do nothing.
Why?
Because I when I am off shift I want to have this task activate when I get text from my staff group on my unrooted S6.
Any and all help would be genuinely appreciated.
You can put more than one condition on a profile. You'd need KC Tasker Process Running plugin to determine if the app is open, as well as being connected to your SSID.
Profile: Example State: Wifi Connected. SSID:YourSSID MAC:* IP:* State: Processes started [ Configuration:com.google.android.youtube ] Enter: Your Task, IE Auto Cast or whatever
Lol /u/ckasdf I have appeared ;)
And yes, that KC Tasker Process Running detects whether an app is running, background or foreground.
So Tasker will know if it's still running even when press the homekey. I would recommend to use it as an Action in the Task that turns off the Bluetooth, and check for the app running right before that happens, and only proceed with the Bluetooth Off IF the app is no longer running (background or foreground).
The plugin lets you set a variable name that will be true
or false
based on the app running / not running.
There's a plugin for this called "KC Tasker Processes". It detects whether an app is running at all, background, etc.
It can be used in a Profile, or called directly in a Task as a query Action.
I just ran across Tasker Process Running (KC) on the play store tonight. From what I understand, it gives Tasker the ability to check if an app is open and running or not.
https://play.google.com/store/apps/details?id=org.kc.tasker.processes
I have yet to play with it, but I think it might be what you are looking for?
To your Profile that runs 7am to 1030pm simply add a context (by long clicking on the existing context) and add context Application>Airwire>Invert
And invert is the little button at the bottom. So that means the profile will only trigger if Airwire isn't running. If it is running, the Profile does nothing.
For the second scenario you'd create a Profile with time context of 22:30 and again App>Aiwire>Invert and link it to your 'Wifi off' Task/Action. Again this will trigger the Profile if time is 22:30 and Airwire ISN'T running.
NOW - something to keep in mind is that the 'Application' Profile Context detects an app running in the foreground. If you're trying to detect if it's running at all anywhere on the device (which can be problematic on its own since some apps running don't appear on the Recent Apps list etc.) you need to use a plugin called KC Process Running.
But it sounds like Airwire will be in the foreground as you talk about while you're watching something on Airwire.
HERE IS SOLUTION:
While setting a timeout for the Profile may work for the period of the timeout chosen, when the timeout expires it'll just start doing the same thing again. And while creating a bunch of Profiles and Variables may work, it's a lot more Profiles and Variables.
So what you want to do is test whether Wave Control has been opened yet? And if it IS open, to NOT go to it again.
So how do you test whether Wave Control has been opened? You need a plugin named Tasker Process Running and basically what this does is test if an app or process is running (whether foreground or background) and returns true is it is.
So basically run that plugin in an Action just prior to your Open Wave Control Action, and only open Wave Control:
IF %wcrunning neq true
Where %wcrunning can be any variable name of your choosing that you set in Process Running plugin. I just chose %wcrunning as an example here. That should solve it flipping back to Wave Control once Wave Control is running.
NOTE: This requires NO additional Profiles and NO global variables. Just one single Action for the plugin, and adding IF to your Wave Control action.
Short simple easy answer.
Download "Tasker Process Running" plugin from PlayStore.
Put it in your Task before whatever you want to happen (or not happen) and choose the app(s) you want to test for. It returns "true" in the variable name you specify if the app you're testing for is running ANYWHERE in the system (background / foreground / etc.)
So just name the variable %app_running and then just make an IF statement wherever needed > IF %app_running neq true
I use this in a ton of Tasks. Works excellent IMO.
Yup, Tasker can only detect if an app is in the foreground. Not if it's running in general. So this plugin:
https://play.google.com/store/apps/details?id=org.kc.tasker.processes
Also glad to know its working for folks. I'd never really heard of it and found it while digging in the PlayStore for 'Tasker Plugins'. Someone just posted about a WiFi force-connect plugin too. Seems more and more devs integrating with Tasker, is great.
Tasker plugin to determine if Maps is running navigation process! https://play.google.com/store/apps/details?id=org.kc.tasker.processes
It works for me. Outputting true or false. https://play.google.com/store/apps/details?id=org.kc.tasker.processes
Heres a less complicated method that doesn't require shell commands. Use KC Processes.
This plugin can detect if an app is running in background : https://play.google.com/store/apps/details?id=org.kc.tasker.processes
While I have not personally used this Tasker plugin, Tasker Process Running seems like it would do the trick for you.
I think you'll need two profiles. The first would be:
Screen off: State -> Display -> Display State = Off. + To check if a background app is running you need a plugin - I use Tasker Process Running (KC)
That would trigger a task that enables the second profile. The second profile would monitor the key press. For that I would use AutoInput That profile would trigger the skip.
I don't use Podcast Addict but I found this, which means you should be able to do System -> Send Intent: Action: com.bambuna.podcastaddict.service.player.jumpforward
Good luck!
Edit: Forgot some things.
You might try Tasker Process Running (KC), especially if you're invoking a non-GPS app while using the GPS apps.
I'm not sure if it will work, but you could try the Tasker Process Running Plugin.
There's also the plugin KC Tasker Process Running
Or if you don't have root. Just use my Tasker plugin ;) https://play.google.com/store/apps/details?id=org.kc.tasker.processes
There is a plugin for testing to see if a process is running.
https://play.google.com/store/apps/details?id=org.kc.tasker.processes
I think you could use Tasker Process Running (KC) to check if a certain app/process is running.