Now that we have all these cool Unix utilities I decided to unleash some AppleScript upon them. The following script will display the output of the calendar command in a dialog, allowing you to then place the contents on the clipboard. Paste the following into script editor, modify to your liking and compile:
set n to do shell script "calendar -f ~/Library/calendar"Some notes to help make this easier to use:
display dialog "Calender:\r" & n buttons {"Clipboard", "OK"}¬
default button 2
if the button returned of the result is "Clipboard" then
set the clipboard to n
display dialog "The calendar is on the clipboard." buttons¬
{"Cool"} giving up after 10 default button 1
-- the "giving up after 10 " part basically assumes it's cool
-- after 10 seconds of inactivity and removes the dialog
end if
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020405001423457