Re: applescript and graphics programs
Re: applescript and graphics programs
- Subject: Re: applescript and graphics programs
- From: email@hidden
- Date: Tue, 11 Jun 2002 18:11:54 EDT
Dear Erik,
GraphicConverter will indeed return the file dimensions
in pixels and the current resolution, allowing you to
calculate the actual size in inches. Cost per seat is
$35 last time I checked. You'll have to excuse
Thorsten's short response; as a German with way too many
things to do, he can sometimes be kurt (but informative
-- the answer he gave you was how to do it using the
AppleScript library of GraphicConverter).
If the department is planning on upgrading PhotoShop to
version 7, you may care to recommend proceeding with
that upgrade quickly instead, as version 7 is quite
scriptable and can also return the information you are
seeking.
Both PhotoShop 7 and Graphic Converter are OS 9 compatible.
FYI: In AppleScript, arrays are called "lists",
multi-dimensional arrays are lists of lists.
Subroutines are called "Handlers."
Step 1 -- good
Step 2 -- good (you can have a hash list to compare to, but with this few a
file types, it would probably be faster to simple have a few nested decisions)
Step 3 & 4 - yup. I'd suggest having a handler for each program that you need
to return
info for and then use a decision based on the filetype/creator to select the
appropriate
handler. Make sure you set the properties to global or write out to the text
file during the handler, since you need to return more than one value.
Step 5 -- yup (see above).
You're all set to proceed.
Best Wishes,
Marc Glasgow
In a message dated 6/11/02 9:24:01 AM, email@hidden writes:
>
Fortunately everyone in my department who uses Quark
>
files has a copy of Quark on their system. And everyone
>
does have Photoshop 6, but when I investigated the
>
dictionary I found that there is very little that is
>
scriptable from Photoshop. It appears that there is an
>
AppleScript OSAX called Photoscripter available that
>
allows more scriptability, from MainEvent, but it is
>
extremely expensive. Too expensive for my small
>
department. I contacted Thorsten Lemke of LemkeSoft,
>
about whether or not GraphicConverter can determine the
>
dimensions and resolution of a file, and his pithy
>
answer was "access the window properties from
>
AppleScript" -- so GraphicConverter will display the
>
file at actual size and resolution?
>
>
I personally use OS X but all of my co-workers use OS 9
>
(hopefully to upgrade within a year or so but, as a
>
temp, I will be long gone by that time). So really I'm
>
looking for the OS 9-compatible solution.
>
>
It looks like GraphicConverter + Quark will be what I
>
need. I'm assuming that I create a script that looks
>
something like this pseudocode:
>
>
1. read all files in a folder into an array of new
>
"GraphicFile" objects
>
>
2. for each object, determine the app to use from the
>
creator code (or my own hash key system, though unsure
>
yet if AS has this ability) and set as an attribute of
>
the object somehow
>
>
3. using the "AppToUse" attribute of a GraphicFile
>
object, open the file with the appropriate application
>
and read its properties. Store the properties as
>
attributes of the object (heightAttribute,
>
widthAttribute, resolutionAttribute, filesizeAttribute)
>
>
4. Finally, for each object in the array, read its
>
attributes and write them to a text file.
>
>
>
How does this sound? Feasible? I don't know how to
>
create objects in AppleScript but I am armed with
>
"AppleScript in a Nutshell", curiosity, and a helpful
>
mailing list. If I am going about this the wrong (or
>
even the right) way, please feel free to comment on my
>
approach!
>
>
>
Thanks everyone,
>
>
>
Erik
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.