(* dm at mayart.de, 2008 Nur Adobe Illustrator CS 4 Alle geöffneten Dokumenten mit nur einer Zeichenfläche werden gesichert und als PDF exportiert. Die Seitengröße wird auf den Dokumentinhalt angepasst. Das Skript muss im Apple Skripteditor als *.scpt gespeichert und kann unter Programme > Adobe Illustrator CSx > Vorgaben > Skripte abgelegt werden. Nach Neustart von Illustrator findet man es im Menü Datei > Skripten. Es geht auch mit dem Skript Menü in OS X (installieren mit AppleScript Utility in Programme > Applescript) oder besser mit FastScripts: . Hier liegen die Skripte in ~/Library/Scripts/... *) tell application "Adobe Illustrator" activate set current_docs to (name of documents) repeat with n in current_docs tell document n try if (count artboards) > 1 then display dialog "Diese Skript funktioniert nicht mit Dokmenten mit mehreren Zeichenflächen." else save set {x, x2, y, y2} to geometric bounds set artboard rectangle of artboard 1 to {x, x2, y, y2} end if on error display dialog "Diese Skript funktioniert nur mit Illustrator CS4." end try end tell my save_as_pdf(n) end repeat end tell on save_as_pdf(the_name) tell application "Adobe Illustrator" set the_doc to document the_name set file_path to (file path of the_doc as text) set the_brick to "" if file_path contains " [Converted]" then set file_path to my search_replace(" [Converted]", "", file_path) set the_brick to "_" end if set new_file_path to my get_new_file_path(file_path, ".pdf") set pdf_doc to (save the_doc in file new_file_path as pdf) close pdf_doc saving no end tell end save_as_pdf on get_new_file_path(file_path, new_suffix) try set file_path to file_path as string copy text 1 thru ((length of file_path) - ((offset of ":" in (reverse of characters of file_path) as string)) + 1) of file_path to folder_path copy text 1 thru (((offset of ":" in (reverse of characters of file_path) as string)) - 1) of ((reverse of characters of file_path) as string) to rev_name copy (reverse of characters of rev_name as string) to file_name set x to (offset of "." in ((reverse of characters of file_name) as string)) set l to length of file_name set the_base to characters 1 through (l - x) of file_name as string if x is 0 or x is 1 then set the_suffix to "" else set the_suffix to characters (l - x + 2) through l of file_name as string set the_suffix to "." & the_suffix end if set new_file_path to folder_path & the_base & new_suffix as string set file_exists to true set n to 0 repeat until file_exists is false try info for alias new_file_path set file_exists to true set n to n + 1 on error set file_exists to false exit repeat end try set the_brick to "_" & (n as text) as string if the_base ends with "_" & (n as text) then set the_base to characters 1 thru ((length of the_base) - (length of the_brick)) of the_base as string set new_name to the_base & the_brick & new_suffix as string else set new_name to the_base & the_brick & new_suffix as string end if set new_file_path to folder_path & new_name as string end repeat return new_file_path on error the error_message number the error_number display dialog "Error: " & the error_number & ". " & the error_message buttons {"Cancel"} default button 1 end try end get_new_file_path on search_replace(searchTerm, replaceTerm, theText) set searchTerm to searchTerm as list set replaceTerm to replaceTerm as list set theText to theText as text set oldTID to AppleScript's text item delimiters repeat with i from 1 to count searchTerm set AppleScript's text item delimiters to searchTerm's item i set theText to theText's text items set AppleScript's text item delimiters to replaceTerm's item i set theText to theText as text end repeat set AppleScript's text item delimiters to oldTID return theText end search_replace