Created
December 5, 2016 11:19
-
-
Save chinying/4c26af960839fb9a57d000c038fd5de4 to your computer and use it in GitHub Desktop.
ppt to pdf automator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- not my code, found on http://apple.stackexchange.com/a/217029 | |
on run {input, parameters} | |
set theOutput to {} | |
tell application "Microsoft PowerPoint" -- work on version 15.15 or newer | |
launch | |
set theDial to start up dialog | |
set start up dialog to false | |
repeat with i in input | |
open i | |
set pdfPath to my makeNewPath(i) | |
save active presentation in pdfPath as save as PDF -- save in same folder | |
close active presentation saving no | |
set end of theOutput to pdfPath as alias | |
end repeat | |
set start up dialog to theDial | |
end tell | |
return theOutput | |
end run | |
on makeNewPath(f) | |
set t to f as string | |
if t ends with ".pptx" then | |
return (text 1 thru -5 of t) & "pdf" | |
else | |
return t & ".pdf" | |
end if | |
end makeNewPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment