[Solved] UIFocus - debugging in .scp vs running .exe

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
OrangeAndBlue
Newbie
Posts: 18
Joined: Thu Feb 06, 2014 5:19 pm

[Solved] UIFocus - debugging in .scp vs running .exe

Post by OrangeAndBlue » Mon Dec 15, 2014 9:52 pm

Hi,

I have a .SCP file working properly on MACHINE_A. I take the script over to MACHINE_B where I build all my scripts. MACHINE_B builds it, I take my EXE, liscense.dat, and the GetWord libraries (because I use those as well) and drop them into MACHINE_A.

MACHINE_A then runs the EXE, can handle the

Code: Select all

GetWindowText 
commands, but fails set focus using the command

Code: Select all

UIFocus
Is there some other files I need to grab?

I brought over all the GetWord*.dll and GetWord*.exe files, but I didn't think they affected UIFocus.

Thank you for your help!
Last edited by OrangeAndBlue on Tue Dec 16, 2014 4:56 pm, edited 1 time in total.

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

Re: UIFocus - debugging in .scp vs running .exe

Post by Marcus Tettmar » Tue Dec 16, 2014 9:18 am

UIFocus is a fairly new command, are you sure machine B has the most up to date version of the compiler?

Compile a script that just does this:

MessageModal>MSCHED_VER

Then run it and see what version is reported.

However, it could also be due to differences between machine a and b. Are they the same version of the OS and is the target app at the same version. The UI functions make use of the apps' "accessibility". Two versions could have different implementations of their "UI Accessible" interface. Older versions likely to be less accessible or not at all.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

OrangeAndBlue
Newbie
Posts: 18
Joined: Thu Feb 06, 2014 5:19 pm

Re: UIFocus - debugging in .scp vs running .exe

Post by OrangeAndBlue » Tue Dec 16, 2014 3:22 pm

On MACHINE_A [Win7] I stepped through the .SCP and received 14.2.02 (used this machine to develop because that is were application is).

On MACHINE_B [Win8] (where I have the license to compile scripts) via the EXE I receive 14.1.08

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

Re: UIFocus - debugging in .scp vs running .exe

Post by Marcus Tettmar » Tue Dec 16, 2014 3:24 pm

UIFocus was added in 14.1, so should be ok in that regard, however there was a small change in the latest version which meant more child objects became visible:

https://www.mjtnet.com/mswhatsnew.htm

Makes sense to make sure both machines are running same version to ensure that isn't the issue first anyway. You could always try the compiled macro on Machine A and see what happens?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

OrangeAndBlue
Newbie
Posts: 18
Joined: Thu Feb 06, 2014 5:19 pm

Re: UIFocus - debugging in .scp vs running .exe

Post by OrangeAndBlue » Tue Dec 16, 2014 4:56 pm

Updating the compiler version looks like it fixed the problem.

Thanks for the help Marcus!

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