Scripting icon copying: Finder barfs - howcome?
Scripting icon copying: Finder barfs - howcome?
- Subject: Scripting icon copying: Finder barfs - howcome?
- From: Charles Arthur <email@hidden>
- Date: Mon, 26 Feb 2001 18:52:15 +0000
Why doesn't this work? I'd like to automate some icon-copying and was
trying to do a demonstration of what I meant.
So of course it wouldn't work. Yet the Finder dictionary (9.0.4, AS 143,
inside leg 32) gives "item" as having "icon" as a property; and files get
inheritance from item.
Here's the scriptlet:
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?
Charles
----------------------------
http://www.ukclimbing.com : 1000+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. Plus Britain's busiest climbing discussion boards. And there's
even a cool shop attached.