私は AppleScript に不慣れで、問題を解決するのに役立つ適切な情報源が見つからないようです。日付と説明を含むファイルがあるとします。
September 5, 2013
Event 1.
September 8, 2013
Event 2.
etc.
ファイルを解析して日付とイベント情報を取得し、Mac カレンダー アプリでこれらの日のイベントを作成します (これらの説明とイベント タイトルを使用)。ただし、次のコードで立ち往生しています。
tell application "Finder"
set Names to paragraphs of (read (choose file with prompt "Pick text file containing track names"))
repeat with nextLine in Names
set x to "Thursday, " & nextLine & " 12:00:00 AM"
if nextLine starts with "Sept" then
tell application "Calendar"
tell calendar "My Calendar"
make new event with properties {description:"Event Description", summary:"Event Name", location:"Event Location", start date:date x, allday event:true}
end tell
end tell
end if
end repeat
end tell
不適切な日付形式について不平を言うため、コードはまだ機能しません。さらに、日付行で 2 行目を読み取る方法がわかりません。助けていただければ幸いです、ありがとう。