Copyright © 2003, 2004 Dave Bayer. Subject to the terms and conditions of the MIT License.
MenuNote is a sample Mac OS X Cocoa application providing a customizable menu bar clock which can display a local time different from the Macintosh system time. This can be useful when traveling, for coping with applications that don't handle time zones gracefully: Pick a home time zone for the Mac, and stick to it. Adjust the time displayed in the menu bar to reflect the current time zone, varying either by geographic or personal convention.
For example, changing time zones causes the application Retrospect to perform a full backup; it believes that all files have been modified. I use MenuNote as a work-around.
This project was based on the tutorial Recent Tunes NSStatusItem. The code for MenuNote could easily be modified to display other information in the menu bar, such as the currently assigned IP address.
This is the version of January 13, 2004. The application is available as MenuNote.sit; it is compiled for OS X 10.3. The web site for MenuNote is www.math.columbia.edu/~bayer/OSX/MenuNote/
This documentation was created using annote.
To adjust MenuNote's format, open the Preferences... menu item. The Time Format: field accepts an arbitrary string, and translates escape codes using Cocoa's date format syntax, as described in Date Formatters:
| %% | a '%' character |
| %a | abbreviated weekday name |
| %A | full weekday name |
| %b | abbreviated month name |
| %B | full month name |
| %c | shorthand for %X %x, the locale format for date and time |
| %d | day of the month as a decimal number (01-31) |
| %e | same as %d but does not print the leading 0 for days 1 through 9 |
| %F | milliseconds as a decimal number (000-999) |
| %H | hour based on a 24-hour clock as a decimal number (00-23) |
| %I | hour based on a 12-hour clock as a decimal number (01-12) |
| %j | day of the year as a decimal number (001-366) |
| %m | month as a decimal number (01-12) |
| %M | minute as a decimal number (00-59) |
| %p | AM/PM designation for the locale |
| %S | second as a decimal number (00-59) |
| %w | weekday as a decimal number (0-6), where Sunday is 0 |
| %x | date using the date representation for the locale |
| %X | time using the time representation for the locale |
| %y | year without century (00-99) |
| %Y | year with century (such as 1990) |
| %Z | time zone name (such as Pacific Daylight Time) |
| %z | time zone offset in hours and minutes from GMT (HHMM) |
In addition, there is rudimentary support for the following extensions:
| %T | cumulative hours, excluding display sleep |
| %U | cumulative minutes, excluding display sleep |
| %V | cumulative seconds, excluding display sleep |
The default format is %a %d %b %I:%M, which produces output of the form Mon 12 Jan 2:41
The source code is bundled with the application as MenuNote.tar.gz
All source code for MenuNote is organized within a directory named source. The XCode project file MenuNote.xcode should be ready to use. To start over, e.g. with a new release of the development tools, or to mimic this setup with a different project, the following directions are how to create a new project in XCode 1.1 that uses source:
-Wall -W -Wno-unused-parameter -Wnewline-eof -WerrorFrom OpenGL.org Discussion & Help Forums: -Wall is warnings you always want because they're always errors; -W is warnings you almost always want because they're almost always errors; -Wno-unused-parameter turns off warnings for unused parameters to functions, which -W turns on; -Wnewline-eof is an Apple-only flag which restores GCC's default of warning if your source file doesn't end with a newline. This is for compatibility with GCC on other platforms; -Werror makes all warnings into errors so you can't ignore them.
source/Scripts/annote.sh source/Scripts/tar.sh source/Scripts/help.shannote.sh assumes that annote has been installed as ~/bin/annote. (Nothing I've tried so far convinces XCode to use my PATH variable.)
tell application "DropStuff"
activate
stuff alias "User:Users:me:Local:Code:MenuNote:build:MenuNote.app:" with format StuffIt5
quit
end tell
do shell script "/Volumes/User/Users/me/Local/Code/MenuNote/source/Scripts/install.sh"