what i want to figure out is how to send a String to iCal 5 on 10.7 which is interpreted the same way as creating a quick event, as if you press CMD+N with iCal in focus and then just type "tea at 5" into the popover.
a simplistic sketch (which doesn't work):
on handle_string(theString)
tell application "iCal"
make new event with theString
end tell
end handle_string
i'm comfortable with programming but never done anything with AppleScript. Is there a reference for application commands?
edit:
this works and it's not even slow, the only caveat is that it breaks the clipboard:
on handle_string(theString)
tell application "LaunchBar"
perform action "Copy" with string theString
end tell
tell application "iCal" to activate
tell application "System Events"
keystroke "n" using {command down}
keystroke "v" using {command down}
keystroke return
end tell
end handle_string
it's sort of finicky to use the clipboard in a script? i can't figure out how to temporarily hold the clipboard content in a variable, and then set the clipboard back to it. i'll accept your answer if you help me with that.
family tea @ 5pm
and poof, there's an even called "tea" at 5pm the same day (if I do it before 5pm) or the next day (if it's already past 5pm). This LaunchBar help page describes it: obdev.at/resources/launchbar/help/WorkingWithCalendars.html