Re: setting file/folder icon by AS ?
Re: setting file/folder icon by AS ?
- Subject: Re: setting file/folder icon by AS ?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 6 Nov 2006 14:27:34 +0100
Hello
Here is a script that I use daily.
It grab the icon of the selected file and paste it to the folder
containing the file.
I hope that you will be able to adjust it to fit your needs.
--[SCRIPT colle_icone]
on run
open ((choose file) as list)
end run
on open (sel)
tell application "Finder" to set f to (sel's item 1) as alias
-- grab the file's icon
my CopyOrPaste(f, "c")
-- now the icon is in the clipboard
tell application "Finder" to set c to (container of f) as alias
my CopyOrPaste(c, "v")
tell application "Finder" to update c
end open
on CopyOrPaste(i, cv)
tell application "Finder"
activate
open information window of i
end tell
delay 0.1
tell application "System Events" to tell process "Finder" to tell
window 1
keystroke tab -- select icon button
keystroke (cv & "w") using command down (* (copy or paste) + close
window *)
end tell -- window 1 then process Finder then System Events
end CopyOrPaste
--[/SCRIPT]
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden