AppleScriptでカレンダー.appに “open file alarm” が登録されない
macOS 10.13.6 カレンダー.app【バージョン10.0 (2195.4.3)】
以下のようなApplescriptで、別のアプリケーションを起動するようにイベントを登録しようとしましたが、イベントは登録できるものの、肝心の「ファイルを開く」が登録されません。別の表現をすると、make new eventは、実行されていますが、 make new open file alarm が登録されません。(エラーはありません)ところが、コメントアウトしている make new sound alarm はきちんと登録できます。
set eStart to date "2018年9月22日 土曜日 13:45:00"
set eEnd to eStart + 15 * minutes
set eName to "Test Sound"
set alarmTime to 0 -- alarm at the exact moment of the event
set theFile to POSIX path of file "/Users/xxx/Desktop/SoundV17/AIFF/2FGFclose1845.aiff"
tell application "Calendar"
set newEvent to make new event at end of events of calendar "FileMaker" with properties {summary:eName, start date:eStart, end date:eEnd}
tell newEvent
-- make new sound alarm at end with properties {trigger date:eStart, sound name:"Glass"}
make new open file alarm at end with properties {trigger date:eStart, filepath:theFile}
end tell
end tell
ちなみに、カレンダー自体は「このMac内」になっています。(iCloudやGoogleカレンダーグループでは、そもそもファイルを開くができません) El Capitan辺りからセキュリティが強化されたことと関係あるのでしょうか。不思議なのは、Automatorからカレンダーに「イベントを登録」のオプションで上記でやりたいことを指定し、実行するときちんと登録できるのです。回避する方法が分かる方、アドバイスをお願いします。
MacBook Pro (15-inch, Late 2016), macOS High Sierra (10.13.6)