How to make Growl usable with cron?

The Growl forums have moved to Google Groups, this forum is read only.
Locked
User avatar
tredje
Harmless
Posts: 2
Joined: Tue Sep 19, 2006 12:46 am

How to make Growl usable with cron?

Post by tredje »

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?
User avatar
tredje
Harmless
Posts: 2
Joined: Tue Sep 19, 2006 12:46 am

When in Rome...

Post by tredje »

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...
Locked