Advertisement
Guest User

AdamTest

a guest
Oct 23rd, 2017
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/sh
  2.  
  3. for FILE in `find "${PWD}" -name \*.pptx -or -name \*.key`; do  
  4.   DIR=`dirname $FILE`
  5.   echo Converting $FILE to PDF
  6.   osascript << EOF
  7. tell application "System Events"  
  8.   tell application "Keynote"
  9.     activate
  10.     open "${FILE}"
  11.   end tell
  12.   tell process "Keynote"
  13.     click menu item "PDF…" of menu of menu bar item "Share" of menu bar 1
  14.     click button "Next…" of sheet 1 of window 1
  15.     keystroke "G" using {command down, shift down}
  16.     keystroke "${DIR}"
  17.     click button "Go" of sheet 1 of sheet 1 of window 1
  18.     click button "Export" of sheet 1 of window 1
  19.   end tell
  20.   do shell script "killall Keynote"
  21. end tell  
  22. EOF  
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement