Batch PNG Convert
21/07/2011mkdir pngs; sips -s format png *.* --out pngs Einfach in einem Verzeichnis mit z.B. eine Menge PSD-Dateien ausführen und man bekommt recht schnell eine PNG-Version dieser Dateien.mkdir pngs; sips -s format png *.* --out pngs Einfach in einem Verzeichnis mit z.B. eine Menge PSD-Dateien ausführen und man bekommt recht schnell eine PNG-Version dieser Dateien.on open these
repeat with this in these
tell application "Finder"
if name of this ends with ".pdf" then
set newname to (characters 1 through -5 of ((name of this) as text)) as text
set newname to newname & "_mail.pdf"
do shell script "sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low " & quoted form of POSIX path of this & " " & "--out " & quoted form of POSIX path of ((container of this) as alias) & quoted form of newname
end if
end tell
end repeat
end open
sips -s format pdf -s dpiHeight 72 -s dpiWidth 72 -s formatOptions low /path/to/pdf.pdf --out /path/to/converted/pdf.pdfSo ist z.B. auch eine deutlich schlankere Version von diesem Skripte (Bilder klein rechnen mit AppleScript) möglich:on open some_items
tell me to activate
display dialog "Längste Seite" default answer "1024"
set mh to (text returned of the result) as integer
repeat with this_item in some_items
rescale_and_save(this_item, mh)
end repeat
end open
to rescale_and_save(this_item, max_length)
set this_item to quoted form of (POSIX path of this_item)
set scaled_dir_path to (do shell script "dirname " & this_item) & "/_scaled/"
do shell script "mkdir -p '" & scaled_dir_path & "';sips -Z " & max_length & " " & this_item & " --out '" & scaled_dir_path & quoted form of (do shell script "basename " & this_item) & "'"
end rescale_and_save