calendar - 使用 applescript 创建带有弹出对话框的日历事件
问题描述
我需要一些帮助,因为我是新手,感谢任何输入。我正在尝试设置一个脚本来创建一个日历事件,询问我事件的日期、时间和持续时间,但我搞砸了一些事情,因为它不断给我错误,例如 Can't make "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
解决方案
推荐阅读
- python-3.x - Pandas reset_index 给出 TypeError:无法比较类型 'ndarray(dtype=float64)' 和 'str'
- python - Python VS 代码不与 IPython 内核连接
- javascript - jQuery字体大小错误的结果
- java - 在Mapstruct中将多个字段映射到一个?
- r - R. 符合条件的样本行(在一个值范围内随机;在另一个值范围内固定)
- vba - VB Round函数改变小数点分隔符
- conda - 多个 conda 安装效率更高吗?
- tshark - 需要从 PCAP 中提取数据,但只获得对话的一方面
- python - 如何在for循环中从列表中添加字典值
- database - 在 MongoDB 中,您可以将来自不同集合的两个索引组合在一起吗?