How to support this blog?

To support this blog, you can hire me as an OmegaT consultant/trainer, or you can send translation and project management jobs my way.

Search the site:

Export your Numbers file to a PDF in the same folder

use AppleScript version "2.4" -- Yosemite (10.10) or later

use scripting additions


property alert_exists : "The PDF already exists. Continue?"

property dialog_yes : "Yes"

property dialog_no : "No"

property export_complete : "The PDF has been exported"


# this script exports a PDF of the frontmost Numbers file

# the Numbers file is saved before export to make sure that it exists

# the PDF file is exported to the same folder as the original file

# if the name of the original is myName.numbers, the PDF name is myName.pdf

# if the PDF already exists it is possible to cancel the export

# once the export is completed, Numbers displays an alert

# and Finder opens the enclosing folder


tell application "Numbers"

# this script exports a PDF of the frontmost Numbers file

set myDocument to (item 1 of (document of windows whose index is 1))

# the file is saved before export to make sure that it exists

save myDocument

set myDocumentName to name of myDocument

set myDocumentPath to file of myDocument as text

end tell


tell application "Finder"

# the PDF file is exported to the same folder as the original file

set myDocumentContainer to (container of file myDocumentPath) as text

end tell


# if the name of the original is myName.numbers, the PDF name is myName.pdf

set myExportedPDF to myDocumentContainer & myDocumentName & ".pdf"


tell application "System Events"

# if the PDF already exists it is possible to cancel the export

if exists file myExportedPDF then

display alert alert_exists as warning buttons {dialog_yes, dialog_no} cancel button dialog_no

end if

end tell


tell application "Numbers"

(close access (open for access (myExportedPDF)))

export myDocument to file myExportedPDF as PDF with properties {image quality:Best}

# once the export is completed, Numbers displays an alert

display alert export_complete

end tell


tell application "Finder"

# and Finder opens the enclosing folder

activate

open myDocumentContainer

end tell


# here again, save this script as an Application, with a funny name

# so that you can easily call with with Spotlight

# I chose "> Numbers PDF"

Popular, if not outdated, posts...

.docx .NET .pptx .sdf .xlsx AASync accented letters Accessibility Accessibility Inspector Alan Kay alignment Apple AppleScript ApplescriptObjC AppleTrans applications Aquamacs Arabic archive Automator backup bash BBEdit Better Call Saul bug Butler C Calculator Calendar Chinese Cocoa Command line CSV CSVConverter database defaults Devon Dictionary DITA DocBook Dock Doxygen EDICT Emacs emacs lisp ergonomics Excel external disk file formats file system File2XLIFF4j Finder Fink Font français Free software FSF Fun Get A Mac git GNU GPL Guido Van Rossum Heartsome Homebrew HTML IceCat Illustrator InDesign input system ITS iWork Japanese Java Java Properties Viewer Java Web Start json keybindings keyboard Keynote killall launchd LISA lisp locale4j localisation MacPort Mail markdown MARTIF to TBX Converter Maxprograms Mono MS Office NeoOffice Numbers OASIS Ocelot ODF Okapi OLPC OLT OmegaT OnMyCommand oo2po OOXML Open Solaris OpenDocument OpenOffice.org OpenWordFast org-mode OSX Pages PDF PDFPen PlainCalc PO Preview programming python QA Quick Look QuickSilver QuickTime Player Rainbow RAM reggy regular expressions review rsync RTFCleaner Safari Santa Claus scanner Script Debugger Script Editor scripting scripting additions sdf2txt security Services shell shortcuts Skim sleep Smultron Snow Leopard Spaces Spanish spellchecking Spotlight SRX standards StarOffice Stingray Study SubEthaEdit Swordfish System Events System Preferences TBX TBXMaker Terminal text editing TextEdit TextMate TextWrangler The Tool Kit Time Capsule Time Machine tmutil TMX TMX Editor TMXValidator transifex Translate Toolkit translation Transmug troubleshooting TS TTX TXML UI Browser UI scripting Unix VBA vi Virtaal VirtualBox VLC W3C WebKit WHATWG Windows Wine Word WordFast wordpress writing Xcode XLIFF xml XO xslt YAML ZFS Zip