(* PDF export droplet, das RagTime-Dokumente zu PDF exportiert. Das Script nimmt an, dass die Dokumente je ein Layout enthalten, dass exportiert werden soll. (Gibt es mehrere, wird das erste exportiert.) © 2015 Thomas Eckert, www.ragtime.de *) on open theItems repeat with anItem in theItems exportSingleFile(anItem as string) end repeat end open on run if false then -- just for debugging: set a path which can be used via "Run Script" exportSingleFile("Macintosh HD:Users:helios:Desktop:Mac-Diagraxmm.rtd") else display dialog "Drag some RagTime files on me" buttons {"Quit"} default button 1 end if end run on exportSingleFile(aFile) set exportTarget to pdfName(aFile as string) tell application "RagTime 6.6" activate open (aFile as alias) set docName to name of document 1 tell application "System Events" to set shouldCreatePDF to not (exists (alias exportTarget)) if shouldCreatePDF then try save layout 1 of document 1 in file exportTarget converting to "Acrobat PDF" with font inclusion without settings dialog end try end if try close document 1 saving no end try end tell end exportSingleFile on pdfName(rtName) if text ((count rtName) - 3) thru last character of rtName = ".rtd" then set rtName to text 1 thru ((count rtName) - 4) of rtName -- remove the ".rtd" suffix end if return rtName & ".pdf" end pdfName