START > APPLESCRIPT > Gebrauchsfertige Scripts > Automatische EPS-Erstellung

Automatische EPS-Erstellung

(mittels Acrobat Professional und Ordner-Aktion)


Dieses FolderAction-Script (Ordner-Aktion) generiert aus PDFs automatisch EPSe. 

Bitte die Kommentare im Script beachten!

Die Export-Optionen müssen im Script an die eigenen Bedürfnisse angepasst werden.

Das Script läuft mit Acrobat 6 und 7 (Pro).


HINWEIS: Die Ordneraktion ist derart gestaltet, daß der Ordner während der Verarbeitung geschützt wird (also keine weiteren Dateien hinzugefügt werden können). Um diesen Status zu verdeutlichen, wird der Ordner zusätzlich rot eingefärbt und nach der Verarbeitung wieder grün. Es können aber dennoch mehrere PDF-Dateien gleichzeitig in den Ordner geworfen werden. Diese werden dann der Reihe nach abgearbeitet. Während der Verarbeitung können nur eben keine neuen PDFs in den Ordner geschoben werden.

   
-- ### FolderAction-Script to automate PDF2EPS-Export using Acrobat Professional 6.x, 7.x ###

-- ::::::::::::::::::::::::::::::::::::::::  hohabadu.de  ::::::::::::::::::::::::::::::::::::::::

(* BEFORE FIRST RUN, YOU HAVE TO DO SOME THINGS:
   Create an workflow-folder with a name like "PDF2EPS" containing 2 folders:
   One inputfolder with name "PDF2EPS_IN" and
   One outputfolder with name  "PDF2EPS_OUT".
   Stick this folder-action-script on the Inputfolder.
   Customize the lines in the middle of the script to your preferred export-options

"Look, Mum! Exporting hundrets of EPS without clicking any menu!"
*)

-- ::::::::::::::::::::::::::::::::::::::::  hohabadu.de  ::::::::::::::::::::::::::::::::::::::::

property destFolder : "" as text

on adding folder items to sourceFolder after receiving theList
   tell application "Finder" to set destFolder to (get container of sourceFolder as text) & "PDF2EPS_OUT" as text
   -- customize this line, if you want to name your output-folder otherwise
   
   my lockActionFolder(sourceFolder)
   
   try
      repeat with c from 1 to count items of theList
         set theItem to item c of theList
         
         tell application "Finder"
            set ItemName to name of theItem
            set destSubFolder to (make new folder at folder destFolder with properties {name:((text 1 thru -5 of ItemName) & ".epse" as text)}) as text
         end tell
         
         tell application "Acrobat 6.0.1 Professional"
            open theItem with invisible
            with timeout of 3600 seconds
               try
                  save document ItemName to file (destSubFolder & ":" & (text 1 thru -5 of ItemName) & ".eps") using EPS Conversion with binary without halftones, annotation, linearize and preview
                  -- customize this lines for your options
                  close document ItemName
               on error errNr
                  display dialog errNr
                  close document ItemName
                  my unlockActionFolder(sourceFolder)
               end try
            end timeout
         end tell
         tell application "Finder"
            try
               set locked of sourceFolder to false
               move theItem to folder destFolder
               set locked of sourceFolder to true
            on error
               set locked of sourceFolder to false
            end try
         end tell
      end repeat
   on error
      my unlockActionFolder(sourceFolder)
   end try
   
   my unlockActionFolder(sourceFolder)
   
end adding folder items to

-----------------------------------------------------------------------------------------------
on lockActionFolder(theFolder)
   tell application "Finder" -- suspend the input-folder + colour red  
      set label index of theFolder to 2
      set locked of theFolder to true
      tell application "System Events" to set folder actions enabled to false
   end tell
end lockActionFolder

on unlockActionFolder(theFolder)
   tell application "Finder" -- enable again the input-folder
      set locked of theFolder to false
      set label index of theFolder to 6
      tell application "System Events" to set folder actions enabled to true
   end tell
end unlockActionFolder
 Im Scripteditor öffnen
  
Kommentar schreiben



Powered By CMSimple Design By NMuD Top