Wednesday, May 24, 2006

Cocoa services support

I've implemented Cocoa services support for Mac OS X. If you drop your into an Applications directory, then next time you log in, there will be a Factor submenu in the Services menu in each application.

Screenshots demonstrate this feature best.

So we launch TextEdit, and type a short Factor expression...

Then we invoke the "Evaluate Selection" service...

And the result is pasted right back into the TextEdit window:

One problem is that if Factor is not running, invoking the service does not launch it. I'm not sure how to fix this; I guess LaunchServices cannot locate the for some reason.

I also implemented support for open events, so dropping a file from the Finder onto the Factor dock icon will open a listener window and run the file.

No comments: