• 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: setting file/folder icon by AS ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: setting file/folder icon by AS ?
      • From: Yvon Thoraval <email@hidden>
References: 
 >setting file/folder icon by AS ? (From: Yvon Thoraval <email@hidden>)
 >Re: setting file/folder icon by AS ? (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Find server name of mounted volume
  • Next by Date: Re: Merge all names into 1 file
  • Previous by thread: Re: setting file/folder icon by AS ?
  • Next by thread: Re: setting file/folder icon by AS ?
  • Index(es):
    • Date
    • Thread