Re: linking images in pagemaker
Re: linking images in pagemaker
- Subject: Re: linking images in pagemaker
- From: has <email@hidden>
- Date: Wed, 19 Sep 2001 19:35:25 +0100
Jerry Meyer wrote:
>
>Andrew referenced my FAVORITE DTP App as such:
>
>We have several hundred pagemaker files with missing links to images.
>
>Is there a way to automate the linking of the image files.
>
>
Try this:
>
set list of DeskTopPublishingPackages to (all DTP applications)
>
check list for all apps whose names are (PageMaker)
>
delete all apps whose names are (PageMaker)
>
=====================================================================
>
Seriously, though. We have upwards of 10,000 PM technical documents in our
>
system, so changing to Quark or something else would be a major undertaking.
When you finally hit that inevitable upgrade bump, I think InDesign would
be your better bet as it can import PM6.5 docs (how seamlessly I don't
know; you'd need to find out). ID can be scripted with AS so you've only
got to get proficient in one language instead of two.
>
I have also been trying to script PageMaker (we use v6.5). Apparently, this
>
App has an INCREDIBLY powerful scripting language. Unfortunately, without a
>
180 IQ and a degree in nuclear physics, learning it may be challenging.
Keeping a reference guide open at all times is pretty much essential when
scripting DTP apps, I think (Hans Hansen's book in PM's case). DTP apps are
complex beasts by nature and just about everything is scriptable, but it
does mean you gotta dig through an awful lot of buttons to find the right
one to push. Not only do you need to know the basics of
programming/scripting (variables, operators, statements, loops, etc), but
you've also got to have good understanding of how the DTP app works so you
know which bits to look up in the list of PM commands.
When I started scripting it via AS, I already had the basics of AS
scripting down pat, so it wasn't too hard to go from there to using AS to
push PM's internal buttons. If you've no prior scripting/programming skills
then it's going to be a good bit tougher (in which case you might want to
try going the pure PMScript route as at least you don't have to think about
shuffling data between AS and PM). OTOH, AS skills will probably stand you
in better stead for the future, plus you get access to OSAXen (nice toys)
and can control other applications as well as PM.
>
Has made some great suggestions for resources (he helped save my butt). I
>
did not find alot of help at the Adobe Forums, though. Let me know if you
>
find another list/resource. I'd also be greatly interested in any script
>
you
>
find/develop to return a list of broken image links in PM files. We have
>
similar problems which we currently handle individually as they appear.
I had been considering how you'd cope with a file containing broken links
when I was figuring the basic approach for Andrew's problem (before I
decided that the simple answer wasn't to break them, merely to change them
from pointing to the old file to pointing to the new). The main problem, as
far as I can see, is that PMScript doesn't have a very flexible Open
command: 'Open fPubname, [cHowToOpen]'. There's no way I can see to tell PM
to open a document supressing any missing font/image dialogs. I'm
reasonably certain that if you use it and a linked file or font is missing
then it'll pop up the usual dialogs, which will bring the whole process
grinding to a halt. Not good. Though I recommend you try this yourself and
let me know if I'm wrong and PM ignores broken links by default when using
'Open', in which case I can rewrite this theory cos it'd make everybody's
lives a bit easier as you can open the file and then use PMScript to return
a list of links via GetLinks.
One way you might get around this 'broken links' dialog problem (unless
there is a proper method in PM and I've simply missed it), is to use a try
statement around 'open [file alias]' in AS and catch any timeouts that
occur. Assuming they've not occurred for some stupid reason like you fed PM
the wrong filepath or set the timeout to less than it takes PM to open the
file then it's a reasonable bet that it's happened because of a missing
font or image.
If all you want to do is automatically check each file to see if there's a
problem, without bothering to figure out what that problem is (which you
could do via AS and have it log a nice list of every found fault in every
file, but will take you rather longer to write a script for), then once a
timeout occurs you'd need to cancel the dialog - I think using Sigma's
Additions to 'type' an Escape should do the trick, I think ('type text
ASCII character 27') - then write the name of the faulty file to a log and
move on to checking the next file.
Not too hard to do once you have a reasonable grasp of AS, I reckon; you
don't even need to use any PMScript to do it. You could write an AS that
looks through a bunch of folders/subfolders overnight, automatically
checking every PM file found to see if it opens ok or not. By the time you
get in next morning you should have a nice big list of files to check
and/or fix... or (hopefully!) a completely empty one.:)
Returning an actual list of broken links would be harder: for that you'd
have to hurdle those damn dialogs as the file opens, and then, if you know
the broken links one had popped up, use GetLinks to return a list of all
links in the file and check each of those linked files exists (which is
probably easier done back in AS).
==================
One other possibility: get totally hardcore on your PM files and attempt to
read them directly. I never tried this with PM, but I did once write an AS
script that could go through an Illustrator EPS file and change all
non-global greyscale colours to a tint of a globally-defined black. (Very
useful for colorising greyscale artwork - somebody else subsequently did a
souped up version that you can find in MacScripter's archives if you're
interested.)
So digging around in big mysterious files is sometimes practical - when
they're nice enough to store the items you want in a nice easy-to-identify
format (in my case, I was looking for colour definitions in amongst a load
of other scary stuff; fortunately Illustrator writes very clean postscript
so they were easy to identify - the same script didn't work with EPS files
from other apps which didn't).
Thus it's just possible that if you change a PM file's file type to TEXT so
you can look around it in something like BBEdit, you may eventually find
something that looks like a regular path: "Hard Disk:folder:filename". And
if you did, you could write a script that digs out everything that looks
like a filepath (Regular Expressions are real good for this sort of thing),
then checks to see if those files exist. Definitely a job for the hacker
types out there.
==================
It does surprise me a bit that PMScript doesn't have more features to deal
with Things That Go Wrong, such as broken links, because that'd have been
really really useful, imho. I guess it's just more geared to automating
publication-building than checking existing pubs.
(OTOH, maybe I've totally missed something, and there's already an existing
PMScript sitting out there in an ftp archive somewhere that'll do exactly
what you're looking for. In which case, sorry to bore so!<g>)
Cheers
has