doesn't run at window open??

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
sunole
Newbie
Posts: 14
Joined: Wed Aug 29, 2007 6:28 pm

doesn't run at window open??

Post by sunole » Mon Jan 12, 2009 5:39 pm

I am using Version 11.0.32
i configure the script trigger to "window event","window open", "Calculator"
uncheck only when visible

the script it:
MessageModal> saw it

The Message does not show up when Calculator is opened but it shows when claculator is closed. shouldn't the scrip run at window open??

this behavior still in 32 ?? can it be fixed? thanks

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Re: doesn't run at window open??

Post by jpuziano » Mon Jan 12, 2009 7:07 pm

sunole wrote:I am using Version 11.0.32
i configure the script trigger to "window event","window open", "Calculator"
uncheck only when visible

the script it:
MessageModal> saw it

The Message does not show up when Calculator is opened but it shows when calculatorr is closed. shouldn't the scrip run at window open??

this behavior still in 32 ?? can it be fixed? thanks
Testing on XP SP3, I confirm this behavior still exists in ver 11.1.

In the example given, I would expect it to trigger as soon as the named window exists (not when closed).

To test, I wrote another little macro to pop up the window:

Code: Select all

Let>RP_WINDOWMODE=2
Run>calc.exe
Another possible problem: According to the Help File, setting RP_WINDOWMODE=2 should make the application (in this case Calculator) start up minimized however that's not what happens - it opens normally and is visible.

Marcus, can you replicate any of the above?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 13, 2009 10:40 am

Can confirm issue when "only when visible" is unchecked. We'll have this fixed in the next maintenance release.

Note that testing this is tricky as you need to make absolutely sure there are no hidden windows on your system containing this text - after editing this macro Macro Scheduler will have one - the trigger box. Windows Vista has a sidebar which usually has a calculator in it - this will also match. So there are sometimes valid reasons why a trigger like this will fail - there could already be a window open with that title. Never-the-less there *is* an issue here and it will be fixed.

RP_WINDOWMODE=2 is working correctly. It is just that Calculator ignores it. If you make a desktop shortcut to calc.exe and tell it to start minimized it will ignore this too. So blame Calculator. RP_WINDOWMODE works fine for other apps such as Notepad:

Let>RP_WINDOWMODE=2
Run>Notepad.exe
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Tue Jan 13, 2009 11:20 pm

WindowsXP sp2
Macro Scheduler 11.1

I can confirm this as well, though easily fixed

Code: Select all

RunProgram>calc.exe
WaitWindowOpen>Calculator
WindowAction>2,Calculator
Cheers
Ken
--Still learning more than contributing--
Macro Scheduler since Version 5.0 - 21/10/1998

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Jan 14, 2009 3:07 am

mtettmar wrote:Can confirm issue when "only when visible" is unchecked. We'll have this fixed in the next maintenance release.
Sounds great, thanks.
mtettmar wrote:Note that testing this is tricky as you need to make absolutely sure there are no hidden windows on your system containing this text - after editing this macro Macro Scheduler will have one - the trigger box. Windows Vista has a sidebar which usually has a calculator in it - this will also match. So there are sometimes valid reasons why a trigger like this will fail - there could already be a window open with that title. Never-the-less there *is* an issue here and it will be fixed.
Noted - thanks again and thanks to sunole for reporting this issue.
mtettmar wrote:RP_WINDOWMODE=2 is working correctly. It is just that Calculator ignores it. If you make a desktop shortcut to calc.exe and tell it to start minimized it will ignore this too. So blame Calculator. RP_WINDOWMODE works fine for other apps such as Notepad:

Let>RP_WINDOWMODE=2
Run>Notepad.exe
Thanks, that's good to know. Presently in the Help File, in the "RunProgram" topic, it says this about RP_WINDOWMODE:
MS ver 11.1 Help File wrote:By setting the RP_WINDOWMODE variable programs can be executed minimized, maximised, hidden or normal. RP_WINDOWMODE can be one of the following :

0: Hidden
1: Normal (default)
2: Minimized
3: Maximized

If you set RP_WINDOWMODE it is used by all subsequent Run Program commands, so remember to set it back if you don't want the same window mode to be used each time.
I followed the instructions but it didn't work as stated... I had no idea that some apps ignore this flag. While its good to know that Calculator is to blame here... can I make one further suggestion?

Could you please add something along these lines to the Help File topic above?
suggested Help File addition wrote:Note: Some programs ignore the RP_WINDOWMODE flag - the Calculator app that comes with Windows XP is one example. The following code could be used to put it into the mode of your choice right after it opens:

RunProgram>calc.exe
WaitWindowOpen>Calculator
//Minimize the app
WindowAction>2,Calculator
Thanks Danish_Ken for posting the above workaround and thanks Marcus for the never ending improvements to both MS and the Help File.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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