RE: Save EPS page from Acrobat
RE: Save EPS page from Acrobat
- Subject: RE: Save EPS page from Acrobat
- From: "Wadson, David" <email@hidden>
- Date: Tue, 16 Nov 2004 14:09:21 -0500
Nope...I haven't monkeyed enough with this script, Acrobat 6 and OS X to
confirm that it works properly. I just know that it works for Acrobat 5 on
OS 9.2.2.
I have noticed on my 10.3.6 machine at work that it's kind of inconsistent
as to what program PDF files want to default to opening with. Once I set the
"Always Open With" option on my Jaguar machine at home, it sticks for all
PDF files but on this Panther box it seems to work on a file by file basis.
Mind you, in this script, it's specifically telling Acrobat to open the PDF
file so I don't understand why it opens with Preview instead.
By storing the specified folders in a property, subsequent runs of the
script retain the chosen values. I did it that way so that the user I wrote
it for could set it up once and then not have to do it again. I also didn't
know where they were going to put those folders I didn't hard-code the
locations into the script. If you recompile the script (i.e. resave it from
Script Editor), the values will revert to null. Remove the three property
declarations and remove if/then statements from the "choose folder" lines
to have the script ask for folders each time it's run.
The bit of code to add ".eps" to the name of the file assumes that the PDF
filename has ".pdf" at the end. "set currentFileShortName to characters 1
thru -5 of currentFileName" strips off that extension so you don't end up
with "filename.pdf.eps". However, if your PDF's filename doesn't have an
extension in the firstplace - "noextension" - you'll end up with
"noexten.eps". The assumption when I wrote the script is that the PDF's had
just been created by Distiller, which puts the extension on.
Wrap the script in an idle handler and you have a basic workflow script than
can watch folder for incoming PDF files and automatically export EPS files.
Granted, Adobe frowns upon such a usage of Acrobat unless each person who
will be using it (i.e. processing files through it), must still own a copy
of Acrobat. You're not supposed to buy just one copy of Acrobat, slap it on
a copy with this script, and have a hundred users throw PDF files at it.
Dave
> ----------
> From: Michael McGonagle
> Sent: Tuesday, November 16, 2004 1:02 PM
> To: AppleScript
> Cc: Wadson, David; Tim Mansour
> Subject: Re: Save EPS page from Acrobat
>
> I tried to run this script, and in my tests, I had two different PDF
> files, one had an icon from Acrobat, and the other had an icon for
> Preview. When the script processed the Acrobat file, it opened up in
> Acrobat, but the one from Preview tried to open up in Preview, and the
> script stops at
>
>
> save document currentFileName to file EPSFilePath using EPS Conversion
>
>
> I can only assume that what is happening is that on the
>
>
> open currentFile
>
>
> this is somehow passed to Preview instead of Acrobat, as Preview opens
> up the file, and Script Editor comes up with the error
>
>
> Acrobat 6.0 Professional got an error: document "BOOK.PDF" doesn't
> understand the save message.
>
>
> Or course, the reason I think for this is due to the document opening
> in Preview. I am running Acrobat 6.0 Professional, might this be a
> possible cause?
>
> Also, on subsequent runs of the script, it doesn't go through the stuff
> to allow the selection of folders, and just tries to continue process
> from where it got the error.
>
> Mike
> On Nov 16, 2004, at 9:33 AM, Wadson, David wrote:
>
> > property sourceFolder : ""
> > property processedFolder : ""
> > property EPSFolder : ""
> >
> > if sourceFolder is "" then
> > set sourceFolder to choose folder with prompt "Pick the PDF
> > source folder."
> > end if
> > if processedFolder is "" then
> > set processedFolder to choose folder with prompt "Pick the
> > folder for processed PDF files."
> > end if
> > if EPSFolder is "" then
> > set EPSFolder to choose folder with prompt "Pick destination
> > folder for the EPS files."
> > end if
> >
> > tell application "Finder"
> > set filesToProcess to every file of sourceFolder whose file type
> > is "PDF "
> > end tell
> > repeat with currentFile in filesToProcess
> > set currentFileName to name of currentFile
> > set currentFileShortName to characters 1 thru -5 of
> > currentFileName
> > set EPSFileName to (currentFileShortName & ".eps") as string
> > set EPSFilePath to (EPSFolder & EPSFileName) as string
> > tell application "Acrobat 6.0.1 Professional"
> > open currentFile
> > save document currentFileName to file EPSFilePath using
> > EPS Conversion
> > close document currentFileName
> > end tell
> > tell application "Finder"
> > move currentFile to processedFolder with replacing
> > end tell
> >
> > end repeat
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden