Re: Coerce small icon into picture (getting the icon)
Re: Coerce small icon into picture (getting the icon)
- Subject: Re: Coerce small icon into picture (getting the icon)
- From: Richard 23 <email@hidden>
- Date: Thu, 30 Nov 2000 13:07:13 -0800
>
I'm trying to return a small icon of a file for a directory lister
>
cgi, and use Akua Sweets to coerce the icon into a picture that
>
Clip2gif later can convert to a gif. However, I can't manage to
>
specify that I want to get the small 8-bit icon, I can only get the
>
default 32x32 icon.
>
>
>
set iconsuite to (the icon for file filename)
>
set the clipboard to iconsuite as picture -- returns 32x32 icon
>
>
>
set iconsuite to (the icon for file filename) as small eight bit icon
>
-- selects last words and gives error "Can't make xxxx into the expected
>
type"
>
set the clipboard to iconsuite as picture
I can answer the Finder part. Take another look at the definition
of icon family in the Finder's dictionary. You'll find contains icon
data for each of the 10 icon resource types. So you don't need to
coerce it, you need to get the property of it:
tell application "Finder"
get icon of item 1
set theIcon to result's small 8 bit icon
end tell
R23