Re: Get a file's icon???
Re: Get a file's icon???
- Subject: Re: Get a file's icon???
- From: Robbie Newton <email@hidden>
- Date: Thu, 07 Mar 2002 20:27:31 -0500
>
-- Requires Sandi's Additons
>
on copyIconToClipboard(thisFile)
>
set thisFile to thisFile as string
>
tell application "Finder"
>
activate
>
set infoWindow to information window of alias thisFile
>
open infoWindow
>
TypeText tab
>
TypeText tab
>
TypeText "a" with Command
>
TypeText "c" with Command
>
close infoWindow
>
end tell
>
end copyIconToClipboard
>
>
Victor
That is great! Finally something that actually works!
BUT...
That active finder statement is not very pleasant. Imagine you are in
FileMaker and you click on the button to get a certain file's icon and is
flashes between the finder and FileMaker.
I am pleased that it works but bummed that I am going to have lightning
striking on the screen when using it.
Any ideas. Below is what I used to test it. If you have FileMaker you can
put it in a script as a perform applescript command. That will give you the
EXACT results that I am getting. Also.. If I take the activate line out, it
does not work.
If this is it. Thank you very much for the help, but I do hope that there is
another solution out there.
TIA
-Robbie
-- Requires Sandi's Additons
tell application "Finder"
try
set thePath to (choose file with prompt "Select a file or folder to
get the icon...")
on error errMsg number errNum
if errNum = -128 then
error number -128
end if
end try
end tell
copyIconToClipboard(thePath as alias)
on copyIconToClipboard(thisFile)
set thisFile to thisFile as string
tell application "Finder"
activate --This is the kicker
set infoWindow to information window of alias thisFile
open infoWindow
TypeText tab
TypeText tab
TypeText "a" with Command
TypeText "c" with Command
close infoWindow
end tell
end copyIconToClipboard
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.