如何获取 _received_ iCal 事件来运行脚本?
我正在尝试编写一个 Applescript,该脚本将根据收到来自其他方的邀请安排的时间进行拨出 Skype 通话。
我认为我可以使用 Skype API 的脚本来进行调用,但是我在使用 iCal 时遇到了困难,方法是
A) 让脚本在后台运行并获取所有新事件的时间,或者
B)获取事件警报以运行一次性脚本。
选项 B) 的问题是,虽然您可以从 iCal 中设置事件以便警报运行脚本,但我需要从已收到的事件中触发此操作。
一个典型的示例是:
- 在主机上运行的所有脚本和 iCal
- 上午 10 点,用户安排下午 3 点**的活动(通过便携式设备上的 google cal)并邀请主机。
- 下午 3 点,主机上的脚本使用 Skype API 呼叫用户。
** 这同样可以发生在未来的某个日期,并且要求仍然有效。
非常感谢您的任何建议!
I'm trying to write an Applescript that will make an outgoing Skype call at times scheduled by received invites from other parties.
I think I'm fine with the script to Skype's API to make the call, however I'm struggling with iCal with either method of
A) getting the script to run in the background and getting the time of all new events, or
B) getting the event alert to run a one-off script.
The issue with option B) is that although you can set events from within iCal so that the alert runs a script, I need to trigger this from events that have been received.
A typical example would be:
- All scripts and iCal running on the Host
- At 10am a User schedules an event (via google cal on portable device) for 3pm** and invites the the Host.
- At 3pm the script on the Host uses Skype API to make a call to the User.
** this could just as equally be on a date in the future and the requirements still hold.
Many thanks for any advice!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 iCal 没有任何通知(某些应用程序确实像 iChat),因此您必须运行“保持打开”的 applescript 应用程序。像这样的事情就可以满足你的“B”场景。注意:您必须在“applescriptPath”变量中添加 applescript 文件(进行 Skype 通话的文件)的路径。
启动后,它将列出您在 iCal 中拥有的所有日历事件。然后它会每 5 分钟自行运行一次。当它运行时,它将根据最初创建的事件列表检查当前事件。如果有新事件,那么您的 applescript 将作为警报添加到新事件中。通过这种方式,它可以跟踪运行之间的当前事件并仅查找新事件。
所以这个脚本对您来说应该是一个很好的起点。请记住将其另存为保持打开的 applescript 应用程序。您可能会想要修改它。例如,我让它检查每个日历中是否有新事件,但您可能有一个想要定位的特定日历。祝你好运。
Since iCal doesn't have any notifications (some applications do like iChat) you'll have to run a "stay open" applescript application. Something like this will do it for your "B" scenario. NOTE: you will have to add the path to your applescript file (the one that makes your Skype call) in the "applescriptPath" variable.
When launched it will get a listing of all the calendar events you have in iCal. It will then run itself every 5 minutes. When it runs it will check the current events against the list of events it originally made. If there are new events then your applescript will be added as an alarm to the new events. This way it keeps track of the current events between runs and only finds the new ones.
So this script should be a good starting point for you. Remember to save it as a stay-open applescript application. You probably will want to modify it. For example I have it checking every calendar for new events but you may have one particular calendar you want to target. Good luck.