Re: applescript and graphics programs
Re: applescript and graphics programs
- Subject: Re: applescript and graphics programs
- From: Erik Price <email@hidden>
- Date: Wed, 12 Jun 2002 11:17:17 -0400
Corny, Ron, David Lloyd, Marc, Hevard, Steve, Cliff, Dave Wadson, has,
Dan, and anyone else who has given input on this project:
Thanks very much for all of your helpful responses and suggestions.
I've learned quite a bit about AppleScript from being subscribed to this
list, and plan to remain subscribed in the future to learn more.
However, a few minutes ago I was informed by my supervisor that
automating the data entry process is not in my department's financial
priorities -- they will do it by hand on a per-file basis.
On the one hand, this is somewhat disappointing, as I had a pretty good
plan in mind which would work for most of the graphics formats, as I
described earlier -- for each file in a folder, extract the relevant
data and write it to an XML file, which would then be POSTed to the web
server where a Perl or Python CGI script would perform the data entry
based on the file. Seeing that happen would have been really really
cool. But on the other hand, this relieves me of a great deal of work
to finish my project, and when my project is finished I can start
looking for a real job, a career. So it's a weight lifted off of my
shoulders.
Of course, as a Mac OS X devotee, I still plan to use AppleScript to
make my own life easier, so this isn't a good-bye -- just a big thank
you.
Erik
On Wednesday, June 12, 2002, at 09:18 AM, Daniel A. Shockley wrote:
Erik,
Take a look at your book for the section about records. It sounds like
you're going to be just saving a bunch of data records to a list, and
then processing each item from the list in order. If that is the case,
what you should use is a list of records that would look something like
this:
{{filename:"beaches23.jpg", filepath:"Macintosh HD:Graphics
Folder:beaches23.jpg", imageheight:423, imagewidth:650},
{filename:"beaches27.jpg", filepath:"Macintosh HD:Graphics
Folder:beaches27.jpg", imageheight:410, imagewidth:634}}
and so on. To add records to the end of a list, you'd do something like:
set newRecord to {filename:"beaches28.jpg", filepath:"Macintosh
HD:Graphics Folder:beaches28.jpg", imageheight:379, imagewidth:578}
set mylist's end to newRecord
mylist
--> RETURNS {{filename:"beaches23.jpg", filepath:"Macintosh HD:Graphics
Folder:beaches23.jpg", imageheight:423, imagewidth:650},
{filename:"beaches27.jpg", filepath:"Macintosh HD:Graphics
Folder:beaches27.jpg", imageheight:410, imagewidth:634},
{filename:"beaches28.jpg", filepath:"Macintosh HD:Graphics
Folder:beaches28.jpg", imageheight:379, imagewidth:578}}
Hope that helps with list of records.
Message: 6
Date: Tue, 11 Jun 2002 16:37:36 -0400
Subject: Re: applescript and graphics programs
Cc: email@hidden
To: garbanzito <email@hidden>
From: Erik Price <email@hidden>
On Tuesday, June 11, 2002, at 03:49 PM, garbanzito wrote:
at 2002 06 11, 09:25 -0400, they whom i call Erik Price wrote:
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
[...]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!
unless you need your GraphicFile objects to respond to
messages, i would not bother with objects, but instead
create a list of records. there are no arrays in
AppleScript. determining AppToUse is a simple test. from
your description, you'd simply default to GraphicConverter
unless a file has an XPress creator code. a hash table would
be overkill, and is not a native data structure. (a few
people have fooled around with creating hash tables; search
the archives if you really want to use one.)
Well, I don't really need a hash table -- if AS supported it then I
would use it, but it's not like I need that kind of functionality. And
if I were a more experienced scripter I might try it for pedagogical
reasons, but at this time I just need to find a solution.
However, it seemed to me that going with objects would be a great way
to
store information about these files, since there are several different
attributes of each file that I need to store and eventually write to
the
file. If AS supports multidimensional lists (is there such a thing?
I'm thinking of an AS analogue to multidimensional arrays), there's no
reason I couldn't use those too: one list of lists, each secondary list
containing the file information (name, size, etc).
Also, in a limited sense I will be using messages with these objects --
apart from simply storing the file information, I will also be writing
this information to a file. It would be easy to write a method to do
this. But again, the fact that I know nothing of how OO programming in
AS works is probably leading me to think I can do things I can't do.
I'm a little more accustomed to OO languages like Java and Python, so
when I read that AS was object oriented, this seemed like a way to go.
-- ----
Daniel A. Shockley
email@hidden
email@hidden
http://www.danshockley.com
_______________________________________________
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.
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
email@hidden
_______________________________________________
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.