automatorでやりたいんです。
automatorで以下のフロー?をやりたいのですがどうすればいいでしょうか。
1、pdfをjpgに分割
2、1の際に保存するフォルダを指定(名前はpdfの名前を自動で持ってくる)
3、2で保存したフォルダをzipに圧縮
4、1のpdfを削除
MacBook Air (13-inch Mid 2013), OS X Mavericks (10.9.3)
automatorで以下のフロー?をやりたいのですがどうすればいいでしょうか。
1、pdfをjpgに分割
2、1の際に保存するフォルダを指定(名前はpdfの名前を自動で持ってくる)
3、2で保存したフォルダをzipに圧縮
4、1のpdfを削除
MacBook Air (13-inch Mid 2013), OS X Mavericks (10.9.3)
完全にご希望に沿うかわかりませんが、選択したファイルをイメージファイルとしてレンダリング後zipで圧縮することなら下記のAutomatorでできることを確認しました。
流れとしては
1) 下記のAppleScriptを実行して選択したファイルの存在するフォルダパスを「変数:保存先」として設定
on run {input, parameters}
set thefile to item 1 of input
tell application "System Events"
set thepath to POSIX path of (container of thefile)
end tell
return thepath
end run
2) 下記のAppleScriptを実行して選択したファイルの名前を「変数:ファイル名」として設定
on run {input, parameters}
set thefile to item 1 of input
tell application "System Events"
set the fileName to the displayed name of thefile
set the fileExtension to the name extension of thefile
set textOffset to the offset of "." & the fileExtension in the fileName
if textOffset is greater than 4 then
set fileName to text 1 through (textOffset - 1) of fileName
end if
end tell
return fileName
end run
3) 「保存先」フォルダにファイルと同じ名前のフォルダを作成しそれを作業フォルダとする
4) 選択したファイルを作業フォルダに移動し、イメージとしてレンダリング、圧縮したファイルを保存先のフォルダに保存
5) 変換前のファイルと圧縮前のイメージファイルが保存された作業フォルダをゴミ箱に移動
実行後は、変換前のファイルがあったフォルダに同じ名前のzipファイルのみが残ります。元のファイルはゴミ箱に残るので作業をやり直したい場合はゴミ箱から救出してください。もっとスマートな方法があるかもしれませんが、一応参考まで。
わざわざコードまで書いて頂きましてありがとうございます。
お手数をおかけしました。
automatorでやりたいんです。