Page 1 of 1

process is running?

Posted: Mon Nov 12, 2012 9:47 am
by link76
how can I check if the process "iexplorer.exe" is running?

Code: Select all

if the process "iexplorer.exe" is read then
.....
thanks

Re: process is running?

Posted: Mon Nov 12, 2012 3:26 pm
by Simon
You can shell "tasklist" it will return all of the running processes.

Simon

Re: process is running?

Posted: Tue Nov 13, 2012 4:17 am
by Mark
Hi,

This works on OSX and Windows:

Code: Select all

function programs
     if the platform is "MacOS" then -- only OSX!
          put shell("ps -xcw") into myList
          put offset("COMMAND",myList) into myColPos
          repeat for each line myLine in myList
               put char myColPos to -1 of myLine & cr after myNewList
          end repeat
          filter myNewList without "(*"
          return line 2 to -1 of myNewList
     else if the platform is "Win32" then
          put line 4 to -1 of shell("tasklist") into myList
          // or use the pv command
          repeat for each line myLine in myList
               put word 1 of myLine & cr after myNewList
          end repeat
          return line 1 to -2 of myNewList
     else
          return empty
     end if
end programs
Kind regards,

Mark