MoveWindow

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
fightcancer
Macro Veteran
Posts: 260
Joined: Fri Apr 15, 2005 8:32 am

MoveWindow

Post by fightcancer » Sat Sep 19, 2009 7:17 pm

Why does...

Code: Select all

MoveWindow>Macro*,0,0
fail to do anything noticeable in MS10? However...

Code: Select all

GetActiveWindow>win,x,y
MoveWindow>%win%,0,0
moves MS10 to 0,0.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Sat Sep 19, 2009 7:55 pm

Hi fightcancer,

The user guide says the MoveWindow command accepts the wildcard, so you would expect it to work. It also says it uses WF_TYPE to filter the windows.

Try this:

Code: Select all

//Filter for visible windows only
Let>WF_TYPE=2
MoveWindow>Macro*,0,0

Gale

fightcancer
Macro Veteran
Posts: 260
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Sat Sep 19, 2009 8:06 pm

Thanks, but even that doesn't work. I'm using MS 10.1.21e w/o no other windows that have the word "macro" anywhere in them AFAIK.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Sat Sep 19, 2009 8:09 pm

Try using the other window commands like GetWindowHandle, GetWindowPos, GetWindowSize, and GetWindowList with Macro* to determine what MoveMacro>Macro* found compared to GetActiveWindow.

The user manual explains it this way:
It is best to try to provide an exact (including case) window title to ensure the correct window is found, as many applications have multiple invisible windows with similar names.

Gale

fightcancer
Macro Veteran
Posts: 260
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Sat Sep 19, 2009 8:24 pm

I would, but I already have a workaround and need to work on this other macro. Thanks though.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Tue Sep 22, 2009 5:34 pm

I'm assuming the Window title Macro* is Macro Scheduler, right?

Add a space after Macro. Like this:

Code: Select all

MoveWindow>Macro *,0,0
This should move the window to the 0,0 position.

fightcancer
Macro Veteran
Posts: 260
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Wed Sep 23, 2009 4:42 am

Didn't work.

Yes, the window title is "Macro Scheduler 10 EVALUATION".

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

View System Windows

Post by gdyvig » Wed Sep 23, 2009 2:43 pm

Hi fightcancer,

Here is a quick way to see what is going on. Use Tools>View System Windows from either the Editor or from the Macro Scheduler Window. Enter the word Macro in the Find field and click the Find button several times until you have seen all of the windows it has found.

You will notice it is finding main windows, forms, toolbar objects. More than one contains the string "Macro " or even "Macro Scheduler 10". Technically all rectangular objects with a handle are "windows" that the MoveWindow and the other Macro Scheduler window commands can act on.

Also keep in mind that the the Macro Scheduler wildcard actually means "contains". So Macro* behaves like *Macro*.

Your workaround with GetActiveWindow works because if you leave out the asterisk wildcard Macro Scheduler looks for an exact match. Even then it is possible for 2 windows to have the same exact title, for example when an application error dialog has the same title as the main window. In that case it is possible Macro Scheduler will not choose the window you intended.


Gale

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