Unable to Getfocus of Foxit Reader

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Unable to Getfocus of Foxit Reader

Post by gchichester » Tue Nov 03, 2015 8:27 pm

I'm at a loss as to how I set the focus to Foxit PDF Reader.
I have it set as my default printer.
My script initiate a print job

[code]Let>IGNORESPACES=0
Let>InvNum=450043
Let>lw=0.75
Let>sw=0.30
CapsOn
WaitWindowOpen>Export Manager - [E0SHPG: Shipment Common Info]
SetFocus>Export Manager - [E0SHPG: Shipment Common Info]
Wait>lw
MouseMove>480,745
LClick
Wait>sw
//Send space to uncheck Print Preview checkbox
Send>
Press Tab
//Send space to select form checkbox
Send>
Press Tab
Wait>lw
Press Enter
Wait>lw
WaitWindowOpen>Print to PDF Document - Foxit Reader PDF Printer
SetFocus>Print to PDF Document - Foxit Reader PDF Printer
Wait>.50
//Tab to file name dialog box
Press Tab *5
Send>%InvNum%
Wait>.50
//View PDF
Press Enter

// Foxit Reader is open at this point but unable to get focus
// I have the same problem with Adobe Reader version 10.0

Wait>sw
Press Ctrl
Send>P
Release Ctrl
Press Enter
[/code]

Once again I have added my code in between a code block. And still not formatting correctly when i Preview or Submit my post
Please someone tell what I'm doing wrong!
Thank you in advance for all your help
Gil

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Re: Unable to Getfocus of Foxit Reader

Post by armsys » Tue Nov 03, 2015 8:54 pm

Hi Gchichester,
What cause you to believe you're getting the focus of Foxit Reader?
Besides, the GetFocus command doesn't exist in MS.

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Re: Unable to get focus of Foxit Reader

Post by gchichester » Wed Nov 04, 2015 11:02 am

Sorry, I use the wrong term in the subject. I meant "Unable to get focus of Foxit Reader"
But If you noticed I do use "SetFocus" in my script.

[quote]What cause you to believe you're getting the focus of Foxit Reader?[/quote]

After I send %InvNum% and save, Foxit Reader opens displaying the document I need to print but the following commands do nothing. If I manually press Ctrl P the print dialog opens

Press Ctrl
Send>P
Release Ctrl
Press Enter
Thank you in advance for all your help
Gil

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

Re: Unable to Getfocus of Foxit Reader

Post by Marcus Tettmar » Wed Nov 04, 2015 11:12 am

Doesn't sound like focus is the issue. You'd get an error if it couldn't find the window.

You may be trying to send it CTRL+SHIFT+p because you've specified upper case "P". Try this instead:

Press Ctrl
Send>p
Release Ctrl

Maybe add a few tiny waits before that Press Enter too:

Press Ctrl
Send>p
Release Ctrl
Wait>0.5
Press Enter
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Re: Unable to Getfocus of Foxit Reader

Post by gchichester » Wed Nov 04, 2015 12:29 pm

Marcus,
As you suggested I change to lowercase p
Also changed Ctrl to LCtrl
Works as needed.
It's strange that If I use uppercase P manually the Print Dialog opens ok
But only lowercase works in the script.

Thanks for your insite.
Thank you in advance for all your help
Gil

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

Re: Unable to Getfocus of Foxit Reader

Post by Marcus Tettmar » Wed Nov 04, 2015 1:19 pm

Do you really use upper case P manually? Are you hitting caps lock and then ctrl+p or holding ctrl+shift+p?

Anyway, I always recommend specifying LOWERCASE letters for shortcut keys because you want the KEY not the CHARACTER.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Re: Unable to Getfocus of Foxit Reader

Post by gchichester » Wed Nov 04, 2015 1:40 pm

I did it manually as a test to see if it would open the Print Dialog.
For the test I had the Caps Lock on.
To tell the truth I didn't notice that the P was uppercase until you pointed it out
In the future if short cuts are not work that the first thing I'll check
Thank you in advance for all your help
Gil

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