Re: set variable to pict file contents? Set file icon to variable
Re: set variable to pict file contents? Set file icon to variable
- Subject: Re: set variable to pict file contents? Set file icon to variable
- From: Andy Wylie <email@hidden>
- Date: Wed, 01 Aug 2001 23:58:01 +1200
on 1/8/01 9:21 AM, Brennan Young at email@hidden wrote:
>
email@hidden wrote
>
>
> And that's the problem: an icon family (or one of its components) and a
>
> picture are completely different data structures.
>
>
>
> So, you can't do something like "set icon of file... to picture of...".
>
>
>
> Unless AppleScript provided some way of conversion between those data types
>
> (see also my post
>
> "Re: Icon picture: Trying again and sharing results"); but this isn't the
>
> case...
>
> Without such tools embedded in AS, you have to use a scriptable graphics
>
> application, or perhaps an OSAX.
>
>
I just heard from Greg (the Akua guy) that Akua sweets support coercion of
>
pictures to icon suites, without any messing about. This script works nicely:
>
>
set f to (choose file)
>
set p to (f as picture)
>
set i_s to p as Icon Suite
>
set the custom icon of f to i_s with compatibility
>
>
>
'with compatibility' ensures that OS 8.1 (or older) icon resources are also
>
created, so is not necessary if you are targeting OS 8.5 or later.
I tried this when you first brought the topic up Brennan with disastrous
results. I used a jpeg as the source and put it on a folder on the desktop,
it did such a good job of making my machine inoperable I decided not to
mention it but since you have... it results in freezes and type 10 errors
everytime the icon is drawn here under 8.6, I was only able to recover
booting from an OS 8.1 disk which ignored the offending 32 bit data (other
ways to recover from that pickle?).
With further testing I get the same result regardless of the source file
type and location so if you must and can't run a pre 8.5 OS don't put it on
anything on the desktop.
I guess you'll see this Greg, I can't find any contact sorry.
_______________________HTH Somebody Andy