• 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: Scripting icon copying: Finder barfs - howcome?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting icon copying: Finder barfs - howcome?


  • Subject: Re: Scripting icon copying: Finder barfs - howcome?
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 26 Feb 2001 11:48:58 -0800

On 2/26/01 10:52 AM, Charles Arthur <email@hidden> wrote:

>tell application "Finder"
> choose file with prompt "Choose something with an icon to copy"
> set theicon to icon of selection
> choose file with prompt "Choose a file whose icon you want to change"
> set thefile to icon of selection
> activate
>end tell
>
>It keeps refusing to copy the icon and throws up various refusals,
>sometimes at different points. What am I overlooking?

The code you posted won't copy an icon. All it does is ask for two
files, and then get the icon of the item selected in the Finder, twice.

The following script will do what you want to do.

set sourceFile to choose file with prompt "Choose something with an icon
to copy"
set destinationFile to choose file with prompt "Choose a file whose icon
you want to change"

tell application "Finder"
set theicon to icon of the sourceFile
set the icon of destinationFile to theicon
activate
end tell

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Scripting icon copying: Finder barfs - howcome?
      • From: Charles Arthur <email@hidden>
  • Prev by Date: Eudora Attachments?
  • Next by Date: Re: weird comparison problem
  • Previous by thread: Re: Scripting icon copying: Finder barfs - howcome?
  • Next by thread: Re: Scripting icon copying: Finder barfs - howcome?
  • Index(es):
    • Date
    • Thread