作为 OSX 初学者,我可以选择哪些方式来编写处理 iCal 数据的应用程序?

发布于 2024-08-17 08:36:00 字数 837 浏览 2 评论 0原文

快速背景知识:我是一名 .NET 开发人员,主要是 Web 开发人员,但在 old skool VBA、WinForms、一些 WPF 和许多服务方面拥有一些经验。

我现在购买了一台新的 Mac(Snow Leopard),并且很喜欢它,并且首先需要一个自定义“应用程序”。

我不需要关于如何构建这个应用程序的明确说明,但我需要一个起点,因为我对 OSX 开发几乎一无所知。即使有工具存在,我真的很想编写这个应用程序作为学习练习。

应用程序:

  1. 应用程序首先需要从 iCal 日历中获取“任务”。
  2. 然后,它需要处理“任务”对象,并将它们转换为 iCal“事件”,“事件”就像日历事件中的那样,例如“去看牙医”。
  3. 最后,应用程序需要将这些“事件”插入到另一个 iCal 日历中。

好吧,很简单。显然我不需要第 2 步的帮助,这只是业务逻辑。一旦内存中有一些对象,我就可以使用它们并创建新对象、ICS 文件或其他任何内容。

但我确实需要有关步骤 1 和 3 的帮助,以及该应用程序的一般存在方式。

例如,有哪些选项?该应用程序会是一项“服务”吗?如果是这样,怎么办?理想情况下,应用程序只会在第一个日历中的“任务”发生变化时执行操作。这可能吗?

最后,我如何以编程方式与 iCal 进行通信,这是我想要的吗?

理想情况下,我希望能够将此应用程序传递给其他人,除了指定是否允许运行以及两个日历的名称之外,不需要太多配置。

理想情况下,它会像应用程序“Growl”一样存在,它只是运行、工作,并且在 OSX 的全局“设置”中具有“设置”表单。

酷,感谢您的帮助!

quick background: I'm a .NET developer, mainly Web, but with some experience in old skool VBA, WinForms, some WPF, and a lot of Services.

I've now bought a new Mac (Snow Leopard), and loving it, and have my first need for a custom "app".

I don't need explicit instructions on how to build this app, but I need a starting point, as I know pretty much nothing about developing for OSX. I'd really like to write this app, even if a tool exists, as a learning exercise.

APP:

  1. The App first needs to take "Tasks" from an iCal calendar.
  2. Then, it needs to process the "Task" objects, and turn them into iCal "Events", "Events" as in a calendar event, like "go to the dentist".
  3. Finally the app needs to insert these "events" into another iCal calendar.

Ok, pretty simple. Obviously I don't need help with Step 2, that's just business logic. Once I have some objects in memory, I can play around with them and create new objects, or ics files, or whatever.

But I do need help with Steps 1, and 3, and in general how the app would exist.

For example, what are the options? Would the App be a "service"? If so, how? Ideally the App would only perform the actions when "Tasks" change in the first calendar. Is this possible?

Finally, how do I communicate programatically with iCal, is what I want possible?

Ideally I'd like to be able to pass this app to someone else, without much need for config, apart from specifying if it's allowed to run or not, and the names of the two calendars.

Ideally, again, it would kinda exists like the app "Growl", which just runs, works, and has a "Settings" form in the global "Settings" for OSX.

Cool, thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

小姐丶请自重 2024-08-24 08:36:00

与 iCal 通信的最简单方法是使用其 Apple Events 脚本化界面。最常见的方法是通过 AppleScript 但还有许多其他选项:我更喜欢 Python 版本的 Appscript (它支持 Ruby 和Objective-C 也是如此)。

但是,任何这些解决方案都需要运行 iCal.app。 Apple 精心提供了日历商店框架,直接访问 iCal 数据的 API。与所有 Cocoa 框架一样,这是针对 Objective-C 的,但也有其他语言的包装器,例如 PyObjC< /a> 提供日历存储的 Python 包装器

在较低级别,有一些开源库可以处理读取和写入 iCalendar格式文件,iCal 知道如何导入和导出。例如,请参阅vobject

The easiest way to communicate with iCal is to use its Apple Events scriptable interface. The most common way to do that is through AppleScript but there are a number of other options: I prefer the Python version of Appscript (it supports Ruby and Objective-C, as well).

However, any of those solutions require the iCal.app to be running. Apple thoughtfully provides the Calendar Store framework, an API to access iCal data directly. As with all Cocoa frameworks, this is for Objective-C but there are wrappers to it from other languages, for instance, PyObjC provides a Python wrapper for Calendar Store.

At a lower level, there are open-source libraries out there that deal with reading and writing iCalendar format files, which iCal knows how to import and export. See, for instance, vobject.

慈悲佛祖 2024-08-24 08:36:00

这只是部分答案,但要让某些东西像 Windows 上的服务一样运行,请使用 launchd< /a>.将您的应用程序构建为控制台程序。

如果您熟悉 C#,请考虑使用 MonoMonoDevelop。 MonoDevelop 之于 Visual Studio 就像 OpenOffice 之于 MSOffice。它实际上是一个非常棒的 IDE,而且是免费的。感觉和Visual Studio几乎一样,甚至会打开并使用Visual Studio项目/解决方案文件!缺点是您的客户需要依赖 Mono 框架(当前为 2.6.1.1)。但它可以作为标准 Mac dmg/安装程序 提供。不管怎样,Mac/Linux 人们已经习惯了依赖关系。

This is only a partial answer, but to get something to run like a service on Windows, use launchd. Build your app as a console program.

If you're familiar with C#, consider using Mono and MonoDevelop. MonoDevelop is to Visual Studio as OpenOffice is to MSOffice. It's actually quite a wonderful IDE and free. It feels almost the same as Visual Studio, and will even open and use Visual Studio project/solution files! The downside is a dependency that your customers will need, the Mono framework (currently 2.6.1.1). But it is available as a standard Mac dmg/installer. And Mac/Linux people are used to dependencies anyway.

离不开的别离 2024-08-24 08:36:00

Apple 提供了 Automator。 http://www.apple.com/downloads/macosx/automator/

做了你读过那件事吗?

它能达到你想要的效果吗?

Apple provides the Automator. http://www.apple.com/downloads/macosx/automator/

Did you read about that?

Does it do what you want?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文