FindObject function problem

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Semper
Junior Coder
Posts: 30
Joined: Mon Feb 25, 2008 3:28 pm

FindObject function problem

Post by Semper » Wed Jul 04, 2012 12:44 pm

Hi,

i have a script which automates a software.
There is a lot of exporting through a child window, and it works
fine 90% of time.
But sometimes it stops with an error: Object not located in FindObject

The same object is found 90% of the time.

The code in question is:

Code: Select all

WaitWindowOpen>Export %Folder%\%File_Name%
Wait>0.5
GetWindowHandle>Export %Folder%\%File_Name%,hWndParent
Wait>1
FindObject>hWndParent,TCheckBox,,12,hWnd,X1,Y1,X2,Y2,result
Any help appriciated.

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

Post by Marcus Tettmar » Wed Jul 04, 2012 1:38 pm

Is there anything different about the window when the error occurs? Are you focusing the window differently, or interacting with it in a different way? It's possible that the z-order has changed and the index of 12 is no longer correct.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Semper
Junior Coder
Posts: 30
Joined: Mon Feb 25, 2008 3:28 pm

Post by Semper » Thu Jul 05, 2012 12:49 pm

There is nothing different.
The script calls and focuses the windows always the same way, many times.

Also, before i put the Wait>1 between FindObject and GetWinHandle the same error fired almost 8 out of 10 times.

But since i have a lot of exporting, i can't really delay more then 1 second, it would take too long to complete the whole process.

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