Re: Scripting icon copying: Finder barfs - howcome?
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. |
----------------------------------------------------------------------