Handle Event of different application


Im just joining in your forum, then Hello to everybody!

Id like to know how I can handle event of different apps in my apple script.

I try to explain in a better way, I need to catch when an app, for instance iTunes, is opening and closing.

I look forward to hearing from you



welcome to our board:)

You can check whether an application is running or not with (for example iTunes)

tell application "System Events"
	set iTunesRuns to (application process "iTunes" exists)
end tell

Yes this is what Im already doing, I need to catch when Skype is closing and reset the status message likes the original.
This is the reason because I need an event. What can I do?