 |
 |
small applescript question
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2003
Location: I'll let you know when I get there...
Status:
Offline
|
|
is there a way to copy the icon of one file and apply to another? if so how would I go about doing this?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
There is probably some way of doing it through UI scripting - but it seems that AppleScript does not do icons any more:
Code:
set chosenFile to choose file without invisibles
tell application "Finder"
get properties of chosenFile
get info for chosenFile
set theIcon to icon of chosenFile
end tell
yields:
Code:
tell current application
choose file without invisibles
alias "WideBoy:Users:diggory:Desktop:Picture 1.pdf"
end tell
tell application "Finder"
get properties of alias "WideBoy:Users:diggory:Desktop:Picture 1.pdf"
{class:document file, name:"Picture 1.pdf", index:17, displayed name:"Picture 1", name extension:"pdf", extension hidden:true, container:folder "Desktop" of folder "diggory" of folder "Users" of startup disk, disk:startup disk, position:{-1, -1}, bounds:{-33, -33, 31, 31}, kind:"PDF Document", label index:0, locked:false, description:missing value, comment:"", size:7.5219E+4, physical size:8.192E+4, creation date:date "Wednesday, December 31, 2003 8:17:05 pm", modification date:date "Friday, January 2, 2004 12:10:10 pm", icon:missing value, URL:"file://localhost/Users/diggory/Desktop/Picture%201.pdf", owner:"diggory", group:"diggory", owner privileges:read write, group privileges:read only, everyones privileges:read only, file type:"PDF ", creator type:"????", stationery:false, product version:"", version:""}
info for alias "WideBoy:Users:diggory:Desktop:Picture 1.pdf"
{name:"Picture 1.pdf", creation date:date "Wednesday, December 31, 2003 8:17:05 pm", modification date:date "Friday, January 2, 2004 12:10:10 pm", icon position:{0, 0}, size:7.5219E+4, folder:false, alias:false, name extension:"pdf", extension hidden:true, visible:true, package folder:false, file type:"PDF ", file creator:"????", displayed name:"Picture 1", default application:alias "WideBoy:Applications:Preview.app:", kind:"PDF Document", locked:false, busy status:false, short version:"", long version:""}
get icon of alias "WideBoy:Users:diggory:Desktop:Picture 1.pdf"
missing value
end tell
The file in question does have a custom icon.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|