Page 1 of 1

How to send ^p (Ctrl-P) to Foxit PhantomPDF?

Posted: 09 Sep 2018, 01:08
by MortenZdk
The Foxit PhantomPDF is a PDF reader and editor.

I would like to make a shortcut for print, thus send ^p (Ctrl-P) to the program, and for this I made the AHK code:

Code: Select all

^!+T::Send ^p
and also tried:

Code: Select all

^!+T::Send {Ctrl Down}p{Ctrl Up}
However, in both cases the PhantomPDF often operates as if sending !p (Alt-P), but some few cases it correctly operates as if sending ^p (Ctrl-P).

Is there some suggestions for how to consistently send ^p (Ctrl-P) to the program?

Re: How to send ^p (Ctrl-P) to Foxit PhantomPDF?  Topic is solved

Posted: 09 Sep 2018, 01:48
by jeeswg
- Perhaps this:

Code: Select all

^!+t::Send {Alt Up}{Ctrl Down}p{Ctrl Up}
- Btw 'T' in hotkeys implies 'shift+t'.

- A screenshot suggests that Foxit PhantomPDF uses a ribbon, perhaps ribbon items can be invoked directly, although I haven't seen any threads on the forum re. this.
- Acc using accDoDefaultAction might work to invoke a button.

Re: How to send ^p (Ctrl-P) to Foxit PhantomPDF?

Posted: 09 Sep 2018, 04:44
by MortenZdk
Thanks for the comments, which made me change the keystroke to access the print dialogue through the ribbon instead, using "{Alt Down}fp{Alt Up}", whereby I got around the problem with non working ^p.

Re: How to send ^p (Ctrl-P) to Foxit PhantomPDF?

Posted: 09 Sep 2018, 06:12
by jeeswg
Btw. For standard context menus (whether the menu bar is standard or not), you can often use PostMessage and WM_COMMAND.
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971

Re: How to send ^p (Ctrl-P) to Foxit PhantomPDF?

Posted: 09 Sep 2018, 08:56
by MortenZdk
Thanks, I have not used PostMessage before, but look like an alternative is sending bare key strokes is not possible or does not work.