script icon
Version: 1.3
Release Date: October 30, 2009
Script Type: Editable
License: Freeware (GPL)
Installation: Download & expand.
Description: This project is a template of sorts demonstrating the following features:
  1. A status menu (similar to a menu extra) with a dynamic submenu.
  2. Options to update the menu title & icon.
  3. Using a timer to animate the menu icon.
  4. Using a view to show a spinning progress indicator in the menu bar (the menu won’t display when this is active though you could add code to respond to a click and display the menu).
  5. Using drag and drop to specify an image.
  6. A background-only toggle to make the app modify itself to be either a standard application with a Dock menu, application menu, and listed in the basic applications list (i.e., the list shown when you do a force quit) or a background-only app with only the status menu visible.
  7. An AppleScript to Objective-C bridge for calling Objective-C methods from AppleScript.
  8. An Objective-C to AppleScript bridge for calling AppleScript handlers from Objective-C.
  9. Registering, reading, and writing defaults using user defaults.
There are some basic comments in the main AppleScript as well as the Objective-C files that describe what is going on in the code.
To enable the background-only feature in your project, modify the internal Info.plist to create the LSUIElement property which toggles the background only bit of an app (you can add this by going to “Build>Edit Active Target For...” from Xcode or Project Builder, go to Expert View under Info.plist Entries, and add a new sibling with a property list of LSUIElement, a class of string, and a value of 1 (for background only) or 0 (for standard)). This has already been enabled in the MenuApp project.
If you incorporate some (or all) of the code from this project into your own (which you are free to do), we’d love to hear about it and a little credit would be nice...