>I've been trying to script Photoshop/PhotoScripter with MacPerl. I
>wasn't able to get very far with the Glue approach. I had more
>success using AppleEvents::Simple, but eventually had to resort to
>MacPerl::DoAppleScript.
Photoshop and Photoscripter are what I'd call a *real* special case.
Photoshop itself has a dynamic dictionary - that's why it opens up if you
try and read the dictionary (at least with Script Editor). Script Editor
says "Hey, this dictionary might get changed when the application runs, so
I'd better not read it until the application is open". Photoscripter, of
course, does just that, it changes the dictionary. But only when the
Application is open.
I don't know what you've tried to get a glue for Photoscripter. This is
what I would recommend (although I don't have a copy myself to test it
with).
Launch Photoshop, with Photoscripter installed. Then try and make a glue
of Photoshop. That should give you the
If that doesn't work, you could try dropping Photoscripter itself onto
gluemac. You shouldn't need to do anything like change the file type to
"APPL", because gluemac doesn't care about those things.
You said you didn't get very far with glue, and ran into problems with
AppleEvent::Simple. What kind of problems? There really *shouldn't* be
any difference between the three approaches (except for things like
application time out, which again shouldn't make a difference).
Open an image.With Glue, I was able to open the image and close it. The size and resolution are special floating point values, and I couldn't get that to work. The radius for USM is floating point, so that wouldn't work either. Saving the document needed parameters to be set, such as the file format, encoding method and so on. I never found a way to make that to work properly, although I got close.
Change the size and resolution.
Apply the USM filter.
Save the document in it's original file format.
Close the document.
adjust docID changing image size to ¬This results in the width, height and resolution being sent as special data types. Cal Simone, the author of PhotoScripter, wrote the following in answer to my question about the stucture of these AppleEvents:
{width:$width as inches, height:$height as inches, resolution:$res as density, interpolation method:bicubic}
"Essentially, unit types are doubleword (8-byte) floating point numbersI have no idea how to accomplish this with Glue or AppleEvents::Simple. It may not be possible becasue of limitations in AEGizmos.
with the data type being a unit of measurement, such as 'inch', 'metr',
'cent', instead of 'doub', the same as typeFloat in Apple Events. So 3.0
as inches is identical in data to just 3.0, except for the descriptor
type which is 'inch' instead of 'doub'."