[ANN] ssNotificationCenter pre-release

Find out what's going on with LiveCode (the company), product releases, announcements, and events.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

[ANN] ssNotificationCenter pre-release

Post by shaosean » Fri Jun 22, 2012 4:51 am

The only thing left to do is testing with the different OS and Rev/LC versions, but I do not see there being any issues anywhere.. I am just releasing this only on the forum (for now).. You can just run the stack with the external in the same folder and it will automatically load for testing..

What it is
Allows your applications to send and receive notifications through the notification center (not the new one in 10.8, see below for more information about why).. For more information about the underlying system APIs check out CFNotificationCenter.

Why
I wrote this after trying, and failing, to get write to process to work..

Requirements
Mac OS X 10.5 or greater (Intel)
Runtime Revolution 4.0 (I have not tested it with other versions of RunRev or LiveCode)

10.8 Notification Center
This does not work with the new notification center that is part of 10.8 (Mountain Lion) as the API has not been made public so there is no way for me to code for it (yet)..

Download

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: [ANN] ssNotificationCenter pre-release

Post by shaosean » Fri Jun 22, 2012 6:30 am

Here are a few notifications to get you started (lines are in the format of notification, object, userInfo):
  • com.apple.screensaver.didstart
  • com.apple.screensaver.willstop
  • com.apple.screensaver.didstop
  • com.apple.iTunes.playerInfo, com.apple.iTunes.player, hasUserInfo
  • com.apple.DownloadFileChanged, filePath
  • com.apple.DownloadFileFinished, filePath
The object com.apple.iTunes.player for com.apple.iTunes.playerInfo is a literal string.
The object for com.apple.DownloadFileChanged and com.apple.DownloadFileFinished is a path to the file being downloaded..
The notification com.apple.DownloadFileChanged is from Safari when a file is downloading and com.apple.DownloadFileFinished is posted when the file is finished.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: [ANN] ssNotificationCenter pre-release

Post by Mark » Fri Jun 22, 2012 9:00 am

Looks very interesting. I'll check it out.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “Announcements”