« February 2006 | Main | April 2006 »
March 31, 2006
Executing an Applescript from Cocoa
So I spent some time digging around and couldn't find much about cocoa+applescript except for examples of how to put the code in the same class as the cocoa. So after looking around, pestering some folks, and coming up with some of my own stuff, this is what I came up with:
#import "RunScript.h"#define runScriptName @"checknewnow"
#define runScriptType @"scpt"
@implementation RunScript- (IBAction)runScript:(id)sender
{
/* Locate that darn thing*/
NSString *scriptPath = [[NSBundle mainBundle] pathForResource: runScriptName ofType: runScriptType];
NSURL *scriptURL = [NSURL fileURLWithPath: scriptPath];
//NSLog(@"%@", scriptURL);NSAppleScript *as = [[NSAppleScript alloc] initWithContentsOfURL:scriptURL error:nil];
[as executeAndReturnError:nil];
//NSLog(@"foomx");
}@end
Thanks to David Smith and Andrew Wellington for their help.
Posted by Chris Forsythe at 11:01 PM | Comments (2)
March 15, 2006
Where are we standing
So I thought I'd give an update about how things are going with ChatKit, so here it is:
• The service plugins API is in place, and looks pretty stable. We'll soon start looking into adding some service plugins (AIM/ICQ (joscar) and GTalk (libjingle)).
• Our plugins API is designed to allow new services to add new features with minimal effort. Just write an ObjC protocol for it and adopt it by your account/contact implementation class. The framework will then support it without any modifications :)
• ChatKit can (in theory) connect to bonjour, get a list of all users and send/receive messages (type ahead and HTML messaging are also supported).
• Static groups are in place. Now I'll start working on virtual/local groups (meaning dynamic (like iTunes's) groups and sub groups).
The only problem is that all of the code is untested. We're working on making a test client to test and demonstrate ChatKit's powers.
Some cool thing ChatKit allows by design are:
• Multiple applications connect to a single daemon and use the same sessions. This means that you'll be able to have, for example, both Adium and Proteus running and connected to the same accounts. Messages will appear in both, and changes made in one will immediately be reflected in the other.
• Since all the communication with the daemon is made using DO, you can connect to remote daemons without additional code. Just imagine the possibilities when you combine it with what I just said before ;-)
• ChatKit is designed to hide the differences between different protocols. ChatKit creates uniform interfaces to access the same feature on multiple services (read the "Writing Service Plugins" manual for more info). This means that if you implement support for nudges in your app, it'll "just work" for both MSN and Yahoo, and even if bonjour will add support for it someday, you'll have to write no code to handle it, except well, enabling a GUI for it ;).
• ChatKit allows different service plugins to implement identical protocols. The host app can then just choose what implementation it prefers based on the features it supports. ChatKit even takes it one step further, and allows you to create 2 sessions of the same protocol using different implementations.
Posted by Ofri Wolfus at 06:05 AM | Comments (2)
March 08, 2006
Higher Order Messagin - Take II
So to continue my last post, you can get the source of my HOM framework at http://trac.dpompa.com/hom. No release is available yet, but you can build from source yourself. The code works fine for me, but wasn't tested by anyone else (yet). If you find any bugs and/or have any comments, please contact me.
Posted by Ofri Wolfus at 10:26 AM | Comments (2)
March 05, 2006
Where does one start with Cocoa?
So every day I get im'd by some random person asking me where to start with Cocoa. They first im asking how I'm doing, but eventually they get to the meat of it.
That started about 9 months ago.
I eventually started creating a page that had some book info, some mailing list info, and some neat websites. It's slowly evolved from something I threw together in five minutes to something that a lot of people seem to like. The point is to have a page that's short and sweet, with no flashy and just some good stuff to start off with.
So take a look at my Beginning with Cocoa page. And if you have any suggestions, leave a comment.
Posted by Chris Forsythe at 11:51 PM | Comments (1)
March 02, 2006
New Growl Extras, part 2
So as I said in my first post about the new Growl Extras, we are including applications/plugins previously considered "third party". The first one I talked about was Feed, an RSS/ATOM news reader. There is also Rawr-Jour, which can detect Rendezvous services broadcasting to your local machine, and notify you of that/give you some power with it.
The new Extra I want to talk about today though is called Gmail+Growl. Gmail+Growl isn't really an application itself, but more along the lines of a plugin of sorts for the official Gmail notifier for OS X. As far as I know Gmail+Growl is the only plugin featured on the Google blog for this application, which says a lot about it.
Gmail+Growl fits into the more traditional role of what a Growl Extra does. GrowlTunes/GrowlMail/GrowlSafari, etc all work with existing applications to bring a better experience to the end user that likes their notifications, and I think Gmail+Growl also does this pretty well.
Here is an example of what it looks like in action:

The envelope looking icon with the (1) next to it in blue is the interface for the Gmail notifier that Google ships. The notification is what Gmail+Growl does. It can look addresses up in the system Address Book, and you can do a lot of other really neat things with it. Overall it's a great add on, and a great addition to the Extras.
I'll be doing my next article on Rawr-Jour. Cheers.
Posted by Chris Forsythe at 06:30 AM | Comments (0)