使用applescript

时间:2018-12-19 16:04:57

标签: calendar applescript

由于我是新手,因此我需要一些帮助,感谢您的投入。我正在尝试设置一个脚本来创建日历事件,询问事件的日期,时间和持续时间,但由于弄不清东西,例如“无法使“ 19.12.1820:06:17” ”输入类型编号,我想它们与格式或其他内容有关吗?

tell application "Calendar"
activate
tell calendar "Work"
    set theCurrentDate to short date string of (current date)
    set theCurrentTime to time string of (current date)
    --Get event Summary
    display dialog "Enter event name:" default answer "Appointment"
    set eventName to text returned of the result
    --Get date
    display dialog "Please enter a date for your event" default answer theCurrentDate
    set eventDate to text returned of the result
    --Get time
    display dialog "Please enter start time" default answer theCurrentTime
    set eventTime to text returned of the result
    set eventStart to eventDate & eventTime
    --Get duration 
    display dialog "Please enter duration in minutes" default answer "120"
    set eventDuration to text returned of the result
    set eventEnd to eventStart + (eventDuration * minutes)
    make new event at end with properties {summary:eventName, location:"url Intercall: xxx PIN: xxx", start date:eventStart, end date:eventEnd, url:"url"}
end tell
reload calendars
end tell

0 个答案:

没有答案