Re: Reality Checked - Exists? = True (What, it's still here?!?)
Re: Reality Checked - Exists? = True (What, it's still here?!?)
- Subject: Re: Reality Checked - Exists? = True (What, it's still here?!?)
- From: has <email@hidden>
- Date: Tue, 11 Sep 2001 02:50:51 +0100
>
Hans: I have maybe two weeks before I'd have to abandon this idea and
>
start working on it manually. Actually, that may be pushing it.
"Hans"? Who he? Ah, you must mean me? Mmmmm, sounds quite bold and dashing
actually, in a bold and dashingly Germanic way. Pity.
>
Nigel: The final PDF's need to contain the following Metadata: Title -
>
Same as the Filename
>
Subject - Used in Document Header varies widely
>
Author - Jerry me (Not at all critical)
>
Keywords - Lists the Document "Form Number(s)" (Our Retrieval Number)
See other post.
>
Finally, my script as it stands now:
>
>
tell application "Finder"
>
set filelist to files of folder "FilesToConvert"
>
end tell
>
repeat with aFile in filelist
>
tell application "Adobe PageMaker 6.5"
Add 'activate' here, especially just now when you're still debugging (it
makes it easier to see what's going on in PM). One of the hassles I had was
with running PM in the background, then not realising when it popped up a
'missing fonts' dialog. Of course, I'm sure you won't have any of those
appearing (you have confirmed all your PM files will be properly behaved,
haven't you?)
>
open aFile
>
with timeout of 3*60 seconds
If you're getting timeout messages because it takes > 3 mins to generate a
.ps file, increase this further. Heck, you could set it to a really huge
value to ensure the script never times out no matter how big and slow a
file is to print. But, while you're debugging, just set it long enough not
to timeout prematurely and test on small, simple PM files. That way, if
something goes wrong the script will still time out eventually and you'll
be alerted to the fact; otherwise you'll be an awful long time debugging.
>
set newfilename to name of aFile
>
if newfilename ends with ".p65" then
>
set newfilename to ("" & ".ps") as text
I have no idea what's going on here.
>
else
>
if (count of newfilename) > 28 then set newfilename to (items 1
>
thru -5 of name of aFile) as text
Or here. I mean, I don't think that's what was in my suggested script. If
it was, I must've been dozing on the job. (I bet I didn't comment it
properly though, which wouldn't help...)
>
end if
>
tell application "PmScript" to run script "PrintToPSFile"
This is something I plain don't understand. Of course, I don't have a copy
of PM on me, so maybe this is a perfectly valid way to run scripts in 6.5.
Can you enlighten me as to what PmScript is/does?
When I were a Lad... and all that... but I do recall that I sent the PM
scripts straight to PM from AS and it worked perfectly. Have you tried
doing it this way? If so, what happened?
>
close without saving
>
end timeout
>
end tell
>
end repeat
>
>
My PageMaker Script "PrintToPSFile" again:
>
Print 1, 0, -2, """.ps"
>
It seems to get there, but always highlites - run script "PrintToPSFile"
>
and displays this message - PmScript got an error: AppleEvent timed out
Is the timeout due to the file being a big one that takes longer than 3
minutes to print? If it's not (and see previous comments above), then this
kinda suggests that something is going wrong with your tell pmscript.
>
I've run the PageMaker Script by itself within the App and it runs fine
>
and produces the proper file with no problem.
Again, a disclaimer: I don't remember the PM scripting language from so
long ago, so I've no idea if using """.ps" results in a ps file named after
the original PM file, but with a .ps extension instead of a .p65 one. Let
me know if this is indeed the case. If it is, you don't need any of that
crap for making ps filenames out of the original PM file's name; but if
not, you will have to go take another long hard look at how I did the
script that I sent previously (even if it was roughed up, untested and
probably in need of a good debug to make it work).
>
The above script was written
>
using 4 or 5 peoples posted snipnets. I know I'm getting close. Any other
>
suggestions/modifications?
FedEx me a PM6.5 disc so I don't feel such a blind fool trying to advise
you on a program that I've spent the last 2 months trying hard to forget
about.;)
Test and debug a snippet at a time. I'd try leaving a PM file open and
testing the tell pmscript line on its own without the rest of the script,
if I were you.
has
p.s. I now remember how I did the PM script part in my own batch-process
script: first I got the dimensions of the document; I also used these to
figure out if the document was landscape or portrait. Then I wrote all the
print dialog values to ensure that, no matter what they might have been
previously (e.g they might have been set to print at 50% on smaller paper,
or maybe to print thumbnails, or low-res images - remember; PM print
settings persist in saved docs since the last time you printed, and may not
be suitable when you want to print to file for Distillation), I always
printed to ps file with the same, suitable, values for scaling, image type,
blank pages included, etc; using the correct PPD; and with appropriate
paper size and orientation. This might seem like overkill, but if you want
to ensure a reliable process then it's the way to do it.
That said, you've still got to get the basics going before you think about
this stuff.