LoginSignup
0
0

More than 5 years have passed since last update.

ドロップしたアイテム名でカレンダーにイベントを追加するdroplet

Posted at

あらかじめ、Calendar.appにsampleというカレンダーが必要です。


on open drop_Items

    set CalendarName to "sample"

    repeat with aItem in drop_Items

        set fname to name of (info for aItem)

        set sTime to (current date)
        set eTime to sTime + (1 * hours)

        tell application "Calendar"
            tell calendar CalendarName
                make new event with properties {summary:fname, start date:sTime, end date:eTime}
            end tell
        end tell

    end repeat
end open

dropletはリストで値が返ってきますので、下記のようにループで処理させるか

repeat with aItem in drop_Items  
    --ループ処理
end repeat

値を1つしか取らないのであれば1番目だけを取得してもいいでしょう

item 1 of drop_Items  
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0