Hello,
I have a Cocoa command-line tool that is designed to be used with cron. I just added Growl support to display a confirmation message just before it quits. It works fine when debugging it or when launching it by hand in the Terminal app. Trying to use it with cron, however, does not work.
Debugging it with NSLog and by looking at the Growl.log, I see that my tool registers itself with Growl as a delegate and when calling [GrowlApplicationBridge notifyWithTitle:...] I see that registrationDictionaryWithGrowl is called again, but then ... nothing happens. No Growl message. Nothing.
Again, Growl works just fine if I launch the tool myself, but not if adding it to crontab. As a test, I added "growlnotify" to the crontab and it also works fine.
So, what is the difference? What is different when cron starts my tool? How can I fix it?
Any ideas?
How to make Growl usable with cron?
When in Rome...
Well, I ended up downloading the sources for growl and re-implementing the interface following the example of growlnotify.
It turns out, when cron launches my executable, no NSConnection can be established and notification is done via the NSDistributedNotificationCenter. As I now have a working solution, digging into this any further has become an academical question...
It turns out, when cron launches my executable, no NSConnection can be established and notification is done via the NSDistributedNotificationCenter. As I now have a working solution, digging into this any further has become an academical question...