Re: Trying again and sharing results
Re: Trying again and sharing results
- Subject: Re: Trying again and sharing results
- From: Brennan Young <email@hidden>
- Date: Mon, 30 Jul 2001 23:37:31 +0200
- Organization: Magic Lantern
Mike Skinner <email@hidden> wrote
>
Hi Brennan
>
>
(Do I recognize that name from Direct-L?)
Yes, but they're all so fierce on that list, I decided to hang out more with
gentler people.
>
Any ideas on where to look for using PICT data in a script?
I've been pretty happy with Akua Sweets for simple graphic manipulations.
You have access to Quickdraw primitives, the Quicktime image importer and a
bunch of other neat things, all without opening an app.
The key (as always) is to coerce to the right datatype. Akua provides 'as
picture' (i.e. PICT), so you can get any Quicktime legible image file into
RAM as a PICT with:
set myPICT to ( (choose file) as picture )
To get a file icon as a pict, use...
set iconPict to ((the icon for (choose file)) as picture)
Akua has a bunch of classes and commands for working with icons.
... and to set a custom icon, you'll need an 'icon suite' object. I don't
know how to make one from scratch. You'd probably need to have one to start
with, and manipulate that.
set the custom icon of (choose file) to someiconSuiteIHadHandy
Note that (choose file) is provided by standard additions, and you might
prefer to make a droplet or something instead to access the file. Just to
get you started, this little utility script will copy any image file dropped
onto it on to the clipboard, using Akua sweets. Save as an applet for that functionality...
on open droppedFiles
set f to item 1 of droppedFiles -- trap for multiple files
if (the image type in f) is "" then -- can Quicktime import it?
display dialog "I can't read that file. Are you sure it's an image?"
return
end if
clip ( ( the image from f ) as picture ) -- get it on the clipboard
end open
--
_____________
Brennan Young
Artist, Composer and Multimedia programmer
mailto:email@hidden
"The devotee believes that Krishna appears when his name is called. The guru
understands that Krishna appears in the spaces between the name calling."
-Swami Wassermann