Pages 13.0 Export to PDF... shortcut?

Pages 13.0 Export to ... shortcut?

I'm trying to create a key command that will take me directly to File > Export To



I've managed to add other key commands for Pages thru: Systems Settings > Keyboard > Keyboard Shortcuts > App Shortcuts...but can't find a way to create one. I know I can hit Command > Print and choose PDF from there. But I often export Pages to Word, etc...


I'm on Ventura 13.4


Any Help?

Posted on Jun 12, 2023 5:43 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 12, 2023 6:51 AM

You cannot assign keyboard shortcuts to parent menu (Export To >) items that have children menu items. The following AppleScript, when used in an Automator Quick Action's Run AppleScript action will pop open the Pages export panel.


Requirements:

  • System Settings > Privacy & Security
    • Automation > Automator
      • Enable Pages
      • Enable System Events
    • Automation > Pages
      • Enable System Events
    • Accessibility panel
      • Enable Automator, and Pages


Once that is done, launch Automator choosing Quick Actions. Here is the Quick Action that tells an open Pages document to open the Export To panel:



With a blank workflow panel on the right-side of the Open Automator window, select Library > Utilities > Run AppleScript and drag/drop it into the larger workflow window. Select all of the content in that Run AppleScript window and remove it. Set the Workflow receives [ no input ] in [ Pages ] at the top of the action.


Now, copy/paste the following content into that Run AppleScript action window, click the hammer icon, and with an open Pages document, click the Automator Run button. If you have set up the bulleted items above beforehand, you should not receive any error dialog from Automator and the Export panel on Pages will open.


# GUI script to tell Pages to open its Export To panel
# Automator will need to be enabled in System Settings > Accessibility panel
# keyboard shortcut can be assigned in System Settings > Keyboard > Keyboard Shortcuts > Services

use scripting additions

on run {input, parameters}
	
	tell application "Pages"
		activate
		tell application "System Events"
			tell process "Pages"
				set frontmost to true
				tell menu item 1 of menu "Export To" of menu item "Export To" of menu "File" of menu bar item "File" of menu bar 1
					perform action "AXPress"
				end tell
			end tell
		end tell
	end tell
	return input
end run


If the action ran as expected with no errors, you can save the Quick Action with some meaningful name (e.g. Open Pages Export Panel) and quit Automator.


In System Settings > Keyboard > Keyboard Shortcuts > Services > General, you should see this new Quick Action entry. If not enabled, click that, and you can enter your keyboard shortcut in the None field. (I used control+command+E which will echo as ^⌘E and then you press return to set the shortcut. You may need to invoke the action manually once from the Pages > Services > General > Open Pages Export Panel, before the keyboard shortcut will work afterward.


Tested: Pages 13 on macOS 13.4.


Caveat: As with any GUI scripting solution, changes made by Apple in future Pages releases may break the above code.

3 replies
Question marked as Top-ranking reply

Jun 12, 2023 6:51 AM in response to pjm0011

You cannot assign keyboard shortcuts to parent menu (Export To >) items that have children menu items. The following AppleScript, when used in an Automator Quick Action's Run AppleScript action will pop open the Pages export panel.


Requirements:

  • System Settings > Privacy & Security
    • Automation > Automator
      • Enable Pages
      • Enable System Events
    • Automation > Pages
      • Enable System Events
    • Accessibility panel
      • Enable Automator, and Pages


Once that is done, launch Automator choosing Quick Actions. Here is the Quick Action that tells an open Pages document to open the Export To panel:



With a blank workflow panel on the right-side of the Open Automator window, select Library > Utilities > Run AppleScript and drag/drop it into the larger workflow window. Select all of the content in that Run AppleScript window and remove it. Set the Workflow receives [ no input ] in [ Pages ] at the top of the action.


Now, copy/paste the following content into that Run AppleScript action window, click the hammer icon, and with an open Pages document, click the Automator Run button. If you have set up the bulleted items above beforehand, you should not receive any error dialog from Automator and the Export panel on Pages will open.


# GUI script to tell Pages to open its Export To panel
# Automator will need to be enabled in System Settings > Accessibility panel
# keyboard shortcut can be assigned in System Settings > Keyboard > Keyboard Shortcuts > Services

use scripting additions

on run {input, parameters}
	
	tell application "Pages"
		activate
		tell application "System Events"
			tell process "Pages"
				set frontmost to true
				tell menu item 1 of menu "Export To" of menu item "Export To" of menu "File" of menu bar item "File" of menu bar 1
					perform action "AXPress"
				end tell
			end tell
		end tell
	end tell
	return input
end run


If the action ran as expected with no errors, you can save the Quick Action with some meaningful name (e.g. Open Pages Export Panel) and quit Automator.


In System Settings > Keyboard > Keyboard Shortcuts > Services > General, you should see this new Quick Action entry. If not enabled, click that, and you can enter your keyboard shortcut in the None field. (I used control+command+E which will echo as ^⌘E and then you press return to set the shortcut. You may need to invoke the action manually once from the Pages > Services > General > Open Pages Export Panel, before the keyboard shortcut will work afterward.


Tested: Pages 13 on macOS 13.4.


Caveat: As with any GUI scripting solution, changes made by Apple in future Pages releases may break the above code.

Jun 12, 2023 9:11 AM in response to pjm0011

Years ago I set a keyboard shortcut for "Save as PDF" using Control+Command+P (⌃⌘P) in all applications. It works for me in macOS High Sierra all the way through to Ventura with varying versions of Pages. With a document open in Pages, I hold down the Command & Control keys & then press the P key & it brings up the export dialog.


In other applications such as Safari, I have to first bring up the Print dialog then the shortcut brings up the Save dialog.


This first screenshot is from macOS Mojave, the second is from Ventura.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Pages 13.0 Export to PDF... shortcut?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.