• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set variable to pict file contents? Set file icon to variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Script Applet rejects first handler call
  • Next by Date: Re: undefined variable
  • Previous by thread: Re: Scripting VSS
  • Next by thread: AppleEvent Timed Out- when running a script from a script
  • Index(es):
    • Date
    • Thread