Lesson Learned: Focus and Press <key>

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Lesson Learned: Focus and Press <key>

Post by Jerry Thomas » Thu Oct 11, 2012 5:24 pm

After taking way too much time to debug, I wanted to share a lesson learned so others might have this in the back of their minds and remember to check for this scenario.

I had a script that launches an app with a file that the user selects (from a MacroScheduler dialog) and then takes actions in that app.

The first action that is scripted for the app, is to dismiss a Splash Screen by pressing enter (default button).
When I would run the script, it would start and then part way through, restart.

Stepping through in debug mode, had no problems.

The issue turned out to be my incorrect "Is window open" code.
So when I executed 'Press Enter' intending to dismiss the Splash Screen, it was actually pressing the Start button on the MS dialog and restarting the script!

ARGHH!
Thanks,
Jerry

[email protected]

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Thu Oct 11, 2012 10:50 pm

Thank you for sharing, Jerry. I'm glad you figured it out, and posted it to help others. :D
Yes, we have a Custom Scripting Service. Message me or go here

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