tumblr uploadr

When I first started working on tumblr uploadr, I spent most of my time figuring out how to wrestle JavaScript and Dasboard into doing file access, uploads, growl and other things that aren’t really exposed to widgets through Dashboard.
If you look through the source code, you’ll notice that a lot of operations are done through widget.system() calls. If you’re not familiar with Dashboard programming, widget.system() is used to call on other programs installed on the mac to do some task.
While using widget.system() to upload files with curl is fine, displaying Growl notifications with external programs is pretty complex and forces shell scripts and AppleScript files to be installed with the widget.
Fortunately, Apple included a way to use system APIs in a much nicer way than hacking together shell scripts and widget.system() calls. The Dashboard API allows for Cocoa bundles to be included with widgets. The bundle, called .widgetplugin, can be loaded at runtime along with a widget and behaves like any other Cocoa application; it can use all the APIs and system calls available to native mac applications.
Starting with beta 2, tumblr uploadr will display Growl notifications through this mechanism. I’m also going to move most of the file handling code to Cocoa as it should be a bit faster than JavaScript and curl.
tumblr uploadr beta 2 can be downloaded here.

When I first started working on tumblr uploadr, I spent most of my time figuring out how to wrestle JavaScript and Dasboard into doing file access, uploads, growl and other things that aren’t really exposed to widgets through Dashboard.

If you look through the source code, you’ll notice that a lot of operations are done through widget.system() calls. If you’re not familiar with Dashboard programming, widget.system() is used to call on other programs installed on the mac to do some task.

While using widget.system() to upload files with curl is fine, displaying Growl notifications with external programs is pretty complex and forces shell scripts and AppleScript files to be installed with the widget.

Fortunately, Apple included a way to use system APIs in a much nicer way than hacking together shell scripts and widget.system() calls. The Dashboard API allows for Cocoa bundles to be included with widgets. The bundle, called .widgetplugin, can be loaded at runtime along with a widget and behaves like any other Cocoa application; it can use all the APIs and system calls available to native mac applications.

Starting with beta 2, tumblr uploadr will display Growl notifications through this mechanism. I’m also going to move most of the file handling code to Cocoa as it should be a bit faster than JavaScript and curl.

tumblr uploadr beta 2 can be downloaded here.

More Information