Skip to content

Instantly share code, notes, and snippets.

@latompa
Created August 2, 2020 19:26
Show Gist options
  • Save latompa/34d7a097461022c5b995726cc9fc698b to your computer and use it in GitHub Desktop.
Save latompa/34d7a097461022c5b995726cc9fc698b to your computer and use it in GitHub Desktop.
convert pages to pdf applescript
on run {input, parameters}
repeat with theFile in input
tell application "Finder"
set theFilesFolder to (folder of theFile) as text
end tell
tell application "Pages"
set theDoc to open theFile
set theDocName to name of theDoc
export theDoc as PDF to file ((theFilesFolder & theDocName & ".pdf") as text)
close theDoc
end tell
end repeat
return input
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment