Rogue Focus

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Rogue Focus

Post by ccris » Fri Mar 02, 2012 3:56 pm

Here's one more challenge:

I have a printer where the printer driver opens a window (window title is "Xi440 CD/DVD Printer") approx 27 seconds after sending a job to print and holds focus onto itself until sec. 31.
The window is not visible, it shows as a minimized window on the Taskbar. Even though it is invisible, it does, however, steal focus onto itself. At sec. 31, this window goes away, and focus returns to whatever I had focus on last time.
At 27 to 31 seconds after sending a job to printer I am always typing something (concerning the next print job), but depending how fast I move I can be in different places: Macro Scheduler paused waiting for input in input Box, opening a new file, typing something in another application, etc.
I am always disrupted by this Rogue Focus.
I have tried making a script that does nothing but loop looking for IfWindowOpen>
WindowAction>3 gets rid of the window, restores focus, but also cancels the print job, no good.
WindowAction>2 works to a certain extent. It restores focus away from rogue window, but only for an instant. After an instant, focus is restored by rogue window onto itself until second 31, when rogue window goes away. Putting WindowAction>2 in a continuous loop while window is open is a partially successful solution: a "tug of war" begins for 4 seconds, with screen flickering between a ghost screen and my application, and focus remains (more or less) on what I am doing (if I am not typing too fast).
I have also tried using OnEvent>WINDOW_OPEN,Xi440 CD/DVD Printer,2,cancel_printer_focus, with cancel_printer_focus doing WindowAction> 2 IfWindowOpen>. Same effect (tug of war, focus more or less remains).

I am wondering if there is a more elegant way of neutralizing this window from stealing focus, without cancelling the print job and without the tug of war effect.

Also, I am wondering if the new solution has to be a separate macro running independently in order to oversee this rogue window, or if it be incorporated into my script (knowing that the script can be in a "paused" state waiting for me to input in the Input> box.

Thanks,

CC

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

Post by JRL » Fri Mar 02, 2012 4:18 pm

If a program is running and is perpetually setting focus to a specific window, there is nothing you can do except wait for that program to stop. Any attempt to set focus to some other window is just going to result in the tug-of-war you've already experienced. You've already discovered that closing the window stops the program and ends the print job so there's no help there. Can you alter the work cycle so you work multiple tasks then batch multiple print jobs?

Might try looking for a different printer driver.

ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Post by ccris » Fri Mar 02, 2012 4:43 pm

Thanks for taking the time to read and responding.
As you took the time to reply, here's some info about batch/drive suggestions:
Batch won't do. This is a single CD printer. I create CD label (automate certain functions with Mac Sch), print CD on the CD that was burnt with matching content, while CD is printing I create next CD label, print, etc.
Printing CDs as a batch job will add 1 step to process (and more time) and if the stack of CDs gets out of sync with print batch there will be errors (printing the label on wrong CD) that I will not be aware of until CD gets to the client.
This printer works only with the one proprietary driver. The company making it is a very shaky customer-unfriendly company. It is a $500 printer (actually worth about $75) but it uses "off-the-shelf" ink. Alternatives: $1000-$3000 CD printers with proprietary ink (at $50-$100 per ink cartridge).
That's why I am trying to live with this printer.....

Thanks again,

CC

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