GetProcessIds never sets an empty array if no PIDs are found

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

GetProcessIds never sets an empty array if no PIDs are found

Post by Grovkillen » Thu Dec 17, 2020 10:35 am

Code: Select all

GetProcessIds>iexplore.exe,array
If>array_count=0
  //this will not be executed if no PID is found...
Endif>
And this would then trigger on the previous query:

Code: Select all

GetProcessIds>explorer.exe,array
GetProcessIds>iexplore.exe,array
If>array_count>0
  //this will be executed even if there's no iexplorer.exe PIDs
Endif>
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: GetProcessIds never sets an empty array if no PIDs are found

Post by PepsiHog » Tue Dec 22, 2020 8:29 pm

Hi Grovkillen,
Will this work for you?

Code: Select all

GetProcessIds>iexplore.exe,array

ArrayCount>array,array_count

If>array_count=0
  mdl>//this will not be executed if no PID is found...
Endif>

Hope so....
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: GetProcessIds never sets an empty array if no PIDs are found

Post by PepsiHog » Tue Dec 22, 2020 8:42 pm

Yeah, I requested years ago for there to be a system variable to make results equal nothing instead of %something%. But Marcus has yet to "make it so". (To my knowledge.)
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts