Acrobat8 ProfesssionalでPDFを回転させるAppleScript
以前見かけたのですが、探したら何故か見つからなかったので作ってみました。
奇数ページを左90度に回転する
tell application "Adobe Acrobat Professional" activate end tell tell application "System Events" tell application process "Acrobat" click the menu item "ページの回転..." of the menu "文書" of menu bar 1 try click radio button "すべて" of group 1 of window "ページの回転" click pop up button 1 of window "ページの回転" click menu item 1 of menu 1 of pop up button 1 of window "ページの回転" click pop up button 1 of group 1 of window "ページの回転" click menu item 3 of menu 1 of pop up button 1 of group 1 of window "ページの回転" -- get every UI element of group 1 of window "ページの回転" click button "OK" of window "ページの回転" end try end tell end tell
偶数ページを右90度に回転する
tell application "Adobe Acrobat Professional" activate end tell tell application "System Events" tell application process "Acrobat" click the menu item "ページの回転..." of the menu "文書" of menu bar 1 try click radio button "すべて" of group 1 of window "ページの回転" click pop up button 1 of window "ページの回転" click menu item 2 of menu 1 of pop up button 1 of window "ページの回転" click pop up button 1 of group 1 of window "ページの回転" click menu item 2 of menu 1 of pop up button 1 of group 1 of window "ページの回転" click button "OK" of window "ページの回転" end try end tell end tell
変更を保存する
tell application "Adobe Acrobat Professional" activate end tell tell application "System Events" tell application process "Acrobat" click the menu item "保存" of the menu "ファイル" of menu bar 1 end tell end tell
色々な所からのコピペの山で形成されてるのであまり意味はわかってないけど動いたのでよしとする。-- はコメントで、elementを表示させる。これで使えるelementが分かったりしたのでした。