Execute Applescript when application is closed
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 开发者_如何学Pythoncurrent 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
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.
精彩评论