应用程序关闭时执行 Applescript
嘿伙计们, 我是一名业余爱好 iPhone 开发者,我感兴趣的是我在某个流程上投入了多少时间。我考虑过使用Applescript,现在我正在尝试实现它。
我想过这样做:使用 Applescript 打开项目。该脚本将当前日期和时间写入文件。现在是重点。第二个脚本应该在我退出 xCode 后立即运行。有可能获得该事件吗?这样我一退出 Xcode 就执行第二个脚本?该脚本应该读取包含开始时间的文件并显示我处理该项目的时间。
我希望你明白我想说的话。 :-D
桑德罗
Hey Guys,
I'm a hobby iPhone Developer and I'm interested how much time I put in a certain process. I thought about using Applescript and now I'm trying to implement this.
I thought about doing it like this: Open the project using an Applescript. This script writes the current date and time to a file. And now the point. The second script should run as soon as I quit xCode. Is there a possibility to get that event? So that the second script is executed as soon as I quit Xcode? This script than should read the file with the start time and show me the time I worked on the project.
I hope you understood, what I tried to say. :-D
Sandro
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是使用空闲处理程序偶尔(例如每 2 秒左右)检查 Xcode 是否仍在运行,并在不再运行时继续运行。这样做的优点是无需任何额外工具即可轻松工作。
另一个选择是 PFiddlesoft 的 UI 操作,它允许您将脚本附加到各种事件。我认为它会退出。
One way is to use an idle handler to check occasionally (say every 2 sec or so) whether Xcode is still running, and continue when it no longer is. This has the advantage of working easily without any additional tools.
Another option is PFiddlesoft's UI Actions, which lets you attach scripts to various events. I think it will do quits.