• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 25 May 2010 13:30:04 -0500

On May 25, 2010, at 12:52 PM, email@hidden wrote:

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

References: 
 >(no subject) (From: email@hidden)

  • Prev by Date: (no subject)
  • Next by Date: [ANN] UI Browser 2.1.0 Released
  • Previous by thread: (no subject)
  • Next by thread: [ANN] UI Browser 2.1.0 Released
  • Index(es):
    • Date
    • Thread