Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Luther Fuller <email@hidden>
- Date: Tue, 25 May 2010 13:30:04 -0500
I am trying to create a script that
will create a folder called "Tools" in the Utilities folder with
an icon I designed. If the folder already exists the script will do nothing
but end. The part I'm having difficulty with is adding the icon. The icon
would not exist on the Mac previous to this script running so how do you
reference it and then make it the icon for the new "Tools" folder. Here's how I do that ...
set selfRef to (path to me) set appSup to (path to application support from user domain) tell application "Finder" set menuFolder to (folder menuFolderName of folder "Menu" of folder "Resources" of folder "Contents" of selfRef) as alias -- internal empty folder with icon if (exists folder menuFolderName of appSup) then set locked of folder menuFolderName of appSup to false (folder menuFolderName of appSup) as alias tell application "System Events" to delete disk item (the result as text) end if set newMenuFolder to (duplicate menuFolder to appSup with replacing) as alias
Notice that my script has been compiled as an application bundle and an empty folder whose name is the string menuFolderName with my icon is included in the application's /Contents/Resources/ folder. (The use of the "Menu" folder is not necessary.)
|
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden