Can't focus or close windows

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
PHG-CWF
Newbie
Posts: 7
Joined: Fri Oct 22, 2010 2:42 pm

Can't focus or close windows

Post by PHG-CWF » Wed Oct 27, 2010 7:34 pm

I'm writing my first script to open Peachtree Accouting, export a report to Excel, save the report, then close both programs.

I can get the script to open Peachtree and export the report, but afterward it will not setfocus on any window or close any window. I've tired Alt+F4, CloseWindow, SetFocus+CloseWindow, Alt+F+X and even using mouse commands.

Any suggestions?

Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

Post by Dick99999 » Thu Oct 28, 2010 8:52 pm

Could you publish some code that you tried. Also which of the alternative close solutions work when doing it manually?

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

Post by Marcus Tettmar » Fri Oct 29, 2010 8:32 am

Maybe it is busy when you're trying to close it. Perhaps you need to wait for it finish whatever it is doing. A bit drastic, but if you want to close the entire application you could try killing it's process using the KillProcess command in v12.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

PHG-CWF
Newbie
Posts: 7
Joined: Fri Oct 22, 2010 2:42 pm

Post by PHG-CWF » Fri Oct 29, 2010 11:53 am

mtettmar wrote:Maybe it is busy when you're trying to close it. Perhaps you need to wait for it finish whatever it is doing. A bit drastic, but if you want to close the entire application you could try killing it's process using the KillProcess command in v12.
I tired a 20 second wait and waitwindowclose.

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