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: Brennan Young <email@hidden>
- Date: Tue, 31 Jul 2001 23:21:27 +0200
- Organization: Magic Lantern
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.
--
_____________
Brennan