Checking to see if process is running?

If you have a question or need help, this is the place to be.
Post Reply
mikesaa309
Posts: 1
Joined: Sun Nov 17, 2013 1:24 pm

Checking to see if process is running?

Post by mikesaa309 » Sun Nov 17, 2013 1:32 pm

Hi,

I'm trying to use several apps on my galaxy s4 to make a homescreen widget to control my pc. So far using zooper widget, tasker, eventghost and autoremote, i have set up a widget where it has three buttons so far. One opens chrome, one opens facebook.com and the last when i click on it launches a tasker scene which is a slider and i can control the computers volume. All work well however i want to make it more intelligent. When i click on chrome it opens just fine however when chrome is already open it opens another instance of chrome but i want it to go to google.com instead if chrome is already open.

I tried using the watch processes plugin but watching the log what happens is chrome process is created then gets deactivated according to the log. Anyway i have it set up so that if the process is created it sends a message to autoremote on my phone which activates a tasker task that sets a new variable %CHROME to 2. Then another one the same way that when the process gets deactivated it sends a message which then sets the %CHROME variable to 1. Then using another tasks it will say if %CHROME matches 2 then send auto remote message to open google.com other wise open chrome.exe. This seem to work fine apart from the fact eventghost seems to log the fact that the process is deactivated after it's launched so this method isn't going to work as well as i hoped. Is there any other way of doing this?

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Checking to see if process is running?

Post by Pako » Sun Nov 17, 2013 2:31 pm

I'm not sure if I understood your problem.
Maybe this will help:
ChromeIsRunning.png
ChromeIsRunning.png (3.48 KiB) Viewed 1069 times
Content of Python Script:

Code: Select all

from eg.cFunctions import GetProcessDict
eg.result = 'chrome.exe' in GetProcessDict().itervalues()
Pako

Post Reply