Last active
May 30, 2017 05:40
-
-
Save eruffaldi/08fcd7349adc787ba40d89665d86afa5 to your computer and use it in GitHub Desktop.
Makefile for papers with figures generated
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
outputs = Generic.pdf Architecture.pdf Hybrid.pdf ConsoleArch.pdf | |
all: ${outputs} | |
tmp.pdf: Images.pptx | |
osascript pptexport.applescript $(abspath $<) $(abspath tmp.pdf) | |
${outputs}: tmp.pdf | |
# map slides to file and crop | |
pdftk tmp.pdf cat 5 output /tmp/tmpc.pdf && pdfcrop /tmp/tmpc.pdf Architecture.pdf | |
pdftk tmp.pdf cat 6 output /tmp/tmpc.pdf && pdfcrop /tmp/tmpc.pdf Generic.pdf | |
pdftk tmp.pdf cat 7 output /tmp/tmpc.pdf && pdfcrop /tmp/tmpc.pdf Hybrid.pdf | |
pdftk tmp.pdf cat 8 output /tmp/tmpc.pdf && pdfcrop /tmp/tmpc.pdf ConsoleArch.pdf | |
rm /tmp/tmpc.pdf |
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
on run {inpath,outpath} | |
set outpathx to POSIX file outpath | |
set outpathy to outpathx as string | |
tell application "Microsoft PowerPoint" -- work on version 15.15 or newer | |
log outpath | |
launch | |
set theDial to start up dialog | |
set start up dialog to false | |
open inpath | |
set outpathy to my createEmptyFile(outpathy) | |
save active presentation in outpathy as save as PDF -- save in same folder | |
close active presentation saving no | |
set start up dialog to theDial | |
end tell | |
end run | |
on createEmptyFile(f) | |
do shell script "touch " & quoted form of POSIX path of f -- create file (this command do nothing when the PDF file exists) | |
return (POSIX path of f) as POSIX file | |
end createEmptyFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment