process is running?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
link76
Posts: 99
Joined: Fri Nov 04, 2011 1:52 pm

process is running?

Post by link76 » Mon Nov 12, 2012 9:47 am

how can I check if the process "iexplorer.exe" is running?

Code: Select all

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: process is running?

Post by Simon » Mon Nov 12, 2012 3:26 pm

You can shell "tasklist" it will return all of the running processes.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: process is running?

Post by Mark » Tue Nov 13, 2012 4:17 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”