Last active
September 3, 2019 02:37
-
-
Save cawka/4cdd4cb6deeef95ad3f66e4536fe01e4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/osascript | |
on run argv | |
if not (count argv) = 2 | |
return "Usage:\n pptx-to-pdf <input file> <output file>" | |
end if | |
set pwd to do shell script "pwd" | |
set _input to item 1 of argv as text | |
set _output to item 2 of argv as text | |
if not _input starts with "/" | |
set _input to pwd & "/" & _input | |
end if | |
if not _output starts with "/" | |
set _output to pwd & "/" & _output | |
end if | |
try | |
set _input to (get POSIX file _input as alias) | |
on error errStr number errorNumber | |
return "ERROR: File [" & _input & "] does not exists or cannot be opened" | |
end try | |
set _output to (get POSIX file _output as string) | |
tell application "Microsoft PowerPoint" -- work on version 15.15 or newer | |
launch | |
open _input | |
save active presentation in _output as save as PDF | |
close active presentation | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment