Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Adding and using keyboard shortcuts in the Print dialog box System
Generally I have found that added keyboard shortcuts for the drop-down menu in the Print dialog (such as in this hint) only work only for the items above the dividing line. As Apple notes, "you can create keyboard shortcuts only for existing menu commands." And all the commands below the dividing line are transient menu items, as they are there only because they are in the PDF Services folder, in the Library folder of the user or the system. If you take them out of there, they will disappear from the Print dialog drop-down. Hence it seems that they are not considered available for keyboard access by the system.

Except there is one way that I have just now discovered to get this to work.

You can use the Tab key to cycle through to the drop-down menu. Now you can use the down arrow to open the menu. At this point, you can use your shortcuts for items below the line. Two things to note when using this method are that the drop-down will not be highlighted as are the other items in the Dialog. However, you can see the highlight move to all the items before and after the drop-down, so you can tell by default when it is selected (four tabs works for me). Also, the shortcuts will not work only by selecting the drop-down, you need to use the down arrow first.

I have, in fact, cobbled together an Automator workflow to automatically download a batch of open tabs or windows using these ideas in an AppleScript along with Automator. Works great -- I did a year's worth of online articles from the fifties in under eight minutes.

[robg adds: Your experience will probably vary by application. In Firefox, for instance, the PDF button (and the others at the bottom of the dialog) aren't included in the Tab cycle, so you can't select it via the keyboard. If you have the expanded print dialog in a given app, it will take more than four tab presses to reach the PDF button.]
    •    
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[7,715 views]  

Adding and using keyboard shortcuts in the Print dialog box | 7 comments | Create New Account
Click here to return to the 'Adding and using keyboard shortcuts in the Print dialog box' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Adding and using keyboard shortcuts in the Print dialog box
Authored by: regulus on Jul 24, '09 08:49:12AM
Counting Tabs and "down arrows" is difficult at best and often subject to change as applications are updated and features are added. If you're going to use gui scripting techniques it's best to press things by name instead. Here's what you can use to do pdf stuff in Safari or Firefox. Just fix the first 2 lines of this applescript as you need.
set webBrowser to "Safari" -- or Firefox
set pdfMenuItemTitle to "Save as PDF…" -- the title of the menu item you want
set myDelay to 0.2

tell application webBrowser to activate
tell application "System Events"
	tell process webBrowser
		-- open the print dialog
		click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
		delay myDelay
		
		-- open the pdf menu items
		if webBrowser is "Firefox" then
			click menu button "PDF" of window "Print"
		else
			click menu button "PDF" of sheet 1 of window 1
		end if
		delay myDelay
		
		-- click the save-as-pdf menu item
		if webBrowser is "Firefox" then
			click menu item pdfMenuItemTitle of menu 1 of menu button "PDF" of window "Print"
		else
			click menu item pdfMenuItemTitle of menu 1 of menu button "PDF" of sheet 1 of window 1
		end if
		delay myDelay
		
		-- make sure the desktop is the location for the saved pdf
		keystroke "d" using command down
		delay myDelay
		
		-- save the pdf
		click button "Save" of window "Save"
	end tell
end tell


[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: Dr. T on Jul 24, '09 09:54:52AM

robg said: "...In Firefox, for instance, the PDF button (and the others at the bottom of the dialog) aren't included in the Tab cycle, so you can't select it via the keyboard...."

You can do these types of tasks easily with QuicKeys X. You also get numerous triggering options: hot key, menu selection, toolbar button, spoken command, scheduled event, or timed event.



[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: ClarkGoble on Jul 28, '09 09:19:52AM

Yeah, a macro program is very worthwhile. Quickeys is a tad pricey though. I use iKey which isn't nearly as elegant but does the job.



[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: MJCube on Jul 25, '09 07:39:10PM

This hint is also dependent on Full Keyboard Access being set to "All Controls". I keep this off normally. (See System Prefs > Keyboard & Mouse > Keyboard Shortcuts.)



[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: Tripp on Jul 25, '09 10:52:54PM

robg said: Your experience will probably vary by application. In Firefox, for instance, the PDF button (and the others at the bottom of the dialog) aren't included in the Tab cycle, so you can't select it via the keyboard. If you have the expanded print dialog in a given app, it will take more than four tab presses to reach the PDF button.]

I checked the above issue with Firefox and it was indeed true in the expanded dialog box, but in the minimal dialog it is was as originally I stated.

But I just downloaded the latest build and it seems to be fixed during the time it took to type this reply. It takes many more tabs in the expanded dialog, but it can now be done. Which is a nuisance in the expanded dialog, as regulus pointed out, but possible.

Having said that, I would have to agree with Rob that your experience will vary with application. As each programer will have his or her own idea on how to lay out the dialog boxes. And some as in the previous Firefox implementation just don't always function very well.

MJCube said: This hint is also dependent on Full Keyboard Access being set to "All Controls". I keep this off normally. (See System Prefs > Keyboard & Mouse > Keyboard Shortcuts.)

Very true. I forgot to mention this in my posting. Thanks for mentioning it.



[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: dowsmith on Jul 31, '09 02:29:07PM

1) I already HAVE Quickeys X, but it similarly struggles to identify the sub-menus: it should be able to 'find' them directly, but instead it can only do this via a mouse-click - which varies...

2) I've being trying in particular to find a way of selecting a Printer Preset, but without success. Anyone any ideas? (I tried the System Prefs/Keyboard shortcut route, but as prev noted, this only works once the drop-down menu has dropped): I can't find any way of automating that 'drop-down' in the first place...



[ Reply to This | # ]
Adding and using keyboard shortcuts in the Print dialog box
Authored by: dcottle on Aug 02, '09 02:23:44PM

Maybe I've misunderstood this hint, but I read the original post and was able to add shortcuts to my (six or so) PDF Services items below the line (Documents, Desktop, ReadMe folder). I've tried them in for or five apps and they work fine. And I can't believe it's taken me this long to find a hint for this. I've been fiddling with Quickeys and Applescripts trying to get it to work for years.



[ Reply to This | # ]