desknet's to iCal
NEO JAPAN のグループウエア「desknet's」の「スケジュール予約状況案内」メールから、iCal のスケジュールに簡単に書き込めるスクリプト。
【利用法】メールの本文を選択してコピーし、このスクリプトを実行すると、予定がiCalに書き込まれます。
(私の実行環境:MacOS X 10.4.10)
AppleScript のソース(スクリプトエディタにコピー)
--
-- クリップボードから必要な情報を抽出
set inData to the clipboard as Unicode text
set pos to offset of "日付:" in inData
set dataLength to the number of characters of inData
set sDate to (characters (pos + 3) thru (pos + 18) of inData as string) & ":00"
set eDate to (characters (pos + 20) thru (pos + 35) of inData as string) & ":00"
set pos to offset of "予定:" in inData
set pos2 to offset of "場所:" in inData
set summ to characters (pos + 3) thru (pos2 - 2) of inData as string
set pos to offset of "利用設備:" in inData
set locate to characters (pos2 + 3) thru (pos - 2) of inData as string
set pos to offset of "内容:" in inData
if pos > 0 then
set memo to characters (pos + 3) thru (dataLength - 1) of inData as string
else
set memo to ""
end if
set summ to summ & "@" & locate
-- カレンダーへの書込
tell application "iCal"
activate
name of calendars whose writable is true
set selectedCalendar to choose from list result
if selectedCalendar is false then return
set selectedCalendar to selectedCalendar as Unicode text
get calendar selectedCalendar
make event at end of events of (calendar selectedCalendar) with properties {summary:summ, start date:date sDate, end date:date eDate, description:memo}
end tell
--
-- 以上