GetActiveWindow

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
wjfinniganjds
Junior Coder
Posts: 24
Joined: Tue Sep 15, 2009 3:20 pm

GetActiveWindow

Post by wjfinniganjds » Mon Mar 22, 2010 2:38 pm

This was in the log file of a script I have running. I have no idea why it failed, and I'm sure there was no window open that was only $. Any idea why it would have failed? Where that $ is comming from?

-WJF

IfWindowOpen>Select Company
3/21/2010 21:30:25:907 - END: else
3/21/2010 21:30:25:907 - START: GetActiveWindow>window_title,nXPos,nYPos,,
3/21/2010 21:30:25:907 - END: GetActiveWindow>window_title,nXPos,nYPos,,
3/21/2010 21:30:25:907 - START: $
3/21/2010 21:30:25:907 - END: $
3/21/2010 21:30:25:907 - START: windowAction>3,$
I think I can automate that!

sarver311
Pro Scripter
Posts: 84
Joined: Tue Jun 17, 2008 6:37 pm

Post by sarver311 » Thu Apr 08, 2010 8:30 pm

Can you post your script that generated this log file?

wjfinniganjds
Junior Coder
Posts: 24
Joined: Tue Sep 15, 2009 3:20 pm

Active Window Garbage

Post by wjfinniganjds » Mon Apr 26, 2010 6:38 pm

Thanks for taking a look. I've moved onto another way of handling it, but still don't understand why the code didn't work.... Here is the raw code:


This script is to log onto our accounting software which they say can't be done by macro software. (I have figured out how to do this reliably with another approach)

label>Login
//Daily Billing Summary

RunProgram>C:\Program Files\Timberline Office\Accounting\IA.exe
WaitWindowOpen>Checking system settings
MoveWindow>Checking system settings,497,465
ResizeWindow>Checking system settings,285,60
// Focus the app
SetFocus>Checking system settings
//Recorded Events
Let>WW_TIMEOUT=120
Let>WSI_TIMEOUT=60
Let>FIP_SCANPIXELS=1000
let>sk_delay=10
CapsOff
wait>10
Send>User Login
Press Tab
Wait>1
Send>User Password
wait>1
Press Tab * 2
// ^=I've had problems with this not always working properly, anyone else?

Press Enter
wait>10
IfWindowOpen>Select Company
//login Successful
else
GetActiveWindow>window_title,nXPos,nYPos,,
Length>%window_title%,Lenwt
%window_title%
If>%lenwt%>1
windowAction>3,%window_title%
IfWindowOpen>Sage Timberline Office - Log On
WindowAction>3,Sage Timberline Office - Log On
endif
//login Failed attempting again
goto>Login
else
IfWindowOpen>Sage Timberline Office - Log On
WindowAction>3,Sage Timberline Office - Log On
endif
//login Failed attempting again
goto>Login
endif
endif
I think I can automate that!

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Apr 26, 2010 7:12 pm

The only time you're going to get to the point in the code that creates the posted lines from the log file, is when login fails. Are you sure that "IA.exe" doesn't open a window named "$"? The window might not be a visible window. Try using Macro Scheduler's "View System Windows" tool and look for a window named "$".

wjfinniganjds
Junior Coder
Posts: 24
Joined: Tue Sep 15, 2009 3:20 pm

Post by wjfinniganjds » Mon Apr 26, 2010 7:17 pm

Your correct, the only time the active window is collected is when it fails.

It is extremely difficult to log onto this specific application, as a result, as part of my efforts to finally get to a point where I can have a reliable login I've been collecting the active window to help me troubleshoot what is going on.

Almost all of my macros do work during the middle of the night, so I'm not sure what is really going on until I get in in the morning. And then I have a jumble of scripts running that make it difficult to decifer what has really occured.

It could be by the time I get in, that the window that was there isn't there anymore. I've never been able to find any of these windows even when searching for them in the window browser.
I think I can automate that!

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

Post by gdyvig » Mon Apr 26, 2010 7:27 pm

Hi wjfinniganjds,


The user documentation does not say whether IfWindowOpen works with your WW_TIMEOUT setting. To be sure, precede it with a WaitWindowOpen command. Also set WF_TYPE to 2 so it will look for a visible window.

Try putting in a ScreenCapture at the point of failure so you can see what was going on in the middle of the night.

Gale

wjfinniganjds
Junior Coder
Posts: 24
Joined: Tue Sep 15, 2009 3:20 pm

Screen capture!

Post by wjfinniganjds » Mon Apr 26, 2010 7:36 pm

Hey that's a great idea thanks for that idea,

I don't know why a screen capture never occured to me.

I'll use that for trapping failures go forward :)

Thanks

-John
I think I can automate that!

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