Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
How to check if a program is running with Ruby?
-
I am pretty sure this can be done. I have done some research but have not found what I am looking for yet.
I just need to know if a given program is running.
Something like this:
if ("indigo.exe").is_running? do something endMaybe it has to be done with a system call...but which call?
-
here is one quick way
require "win32ole" procs = WIN32OLE.connect("winmgmts;\\\\.") all_proc = [] procs.InstancesOf("win32_process").each do |proc| all_proc.push proc.name.to_s.downcase end p all_proc.include?("indigo.exe") -
Thanks, but I get this error message when SketchUp loads:
Error Loading File ProcessTest.rb No such file to load -- win32oleIt would be great if this would work without the need for another file.
-
you need win32ole.so for that example.
... but you still need another file to access process identification (win32ole or win32api)
Advertisement