Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Friday, December 29, 2006

Automator command line utility bug?

OS X comes with a commant line utility, /usr/bin/automator to execute Automator workflows from the command line. This is what man automator has to say:

NAME
automator -- runs an Automator workflow

SYNOPSIS
automator document

DESCRIPTION
automator runs the specified workflow document. To create or edit a
workflow, use the Automator application. There are no options.

Not very usefull. All we know now is how to specify which workflow we want to be run, no information on how to add input to the workflow, like a list of url's or a list of files.

I created a simple test workflow that display's two confirmation boxes. When the first one is dismissed with a negative response, the second one shouldn't appear. This works fine in Automator, when run I am presented with a dialog, when I click OK I get to see the second dialog. But when I run the workflow using /usr/bin/automator I never see the second dialog.

Some research using strings /usr/bin/automator reveals the presence of applicationShouldTerminateAfterLastWindowClosed: So perhaps this selector causes /usr/bin/automator to terminate after a dialog is closed, even before the Automator action is completed succesfully.

Tuesday, December 19, 2006

JKDistributedView

While trying to duplicate the RuleView used by Apple in the Finder for example I ran into the problem of resizing views. The RuleView needs to grow in size when a new rule is added. Each view following the RuleView needs to be resized to to create space for the RuleView. Since layout in InterfaceBuilder works using springs, but you can't attach two edges of view together, I created a helper view called JKDistributedView which helps me resize and reposition it's children views.



To use JKDistributedView you add a NSView subclass to Interface Builder and set it's custom class to JKDistributedView. Every nsview added to JKDistributedView will be layout according to the following rules:

  • top to bottom
  • Every view will get it's preferred height
  • When a views vertical springs are dynamic the view will fill all remaining vertical space after the fixed height views are sized.
When a rule is added to the JKRuleView it needs to grow in size. JKRuleView calls descendantFrameChanged: on it's parent view (JKDistributedView) to indicate all children of JKDistributedView need to be resized and repositioned.

So the finder smart folder view would be created using 3 views as subviews in a JKDistributedView. The JKRuleView, the NSOutlineView (using a dynamic vertical resize hint) and a third view at the bottom to display the path of the selected file. JKDistributedView makes sure the JKRuleView and the path view have a fixed size, the NSOutlineView will fill all space in between. Now when you click the add button in the JKRuleView a new rule will be added, JKDistributedView will increase JKRuleViews height and decrease the height of the NSOutlineView

Tuesday, November 07, 2006

More on SimilarTunes

Currently SimilarTunes is a very simple application to help you create playlists with somehow similar songs from your own library. After searching for an artist you set the similarity slider to the percentage of similarity of the songs and you create the playlist. To figure out how similar songs are, SimilarTunes uses several webservices like Last.fm and MusicMobs.

After posting this software on osx.iusethis.com, I received a few positive reactions. SimilarTunes was even mentioned on the MusicMobs weblog. I'm currently working on fixing one known problem: SimilarTunes only creates empty playlists for one user. I'm also working on some additional features, like adding the original artists searched for to the playlist.

Competition
There is some competition out there trying to reach the same goal, automatically create playlists with similar music:

While I use webservices based on social community input to determine similarity, most other software use properties like beat per minute count of a song to find similar music.

One particular interesting application is Tangerine recently introduced by Potion Factory. It's the only mac application in the list. Like most others it analyzes the BPM count of a song but it really adds a innovative and delicious UI.

Monday, October 30, 2006

My Software

So far I didn't create really interesting software yet. Most of the stuff I created isn't finished yet or abandoned already. However there are a few pieces of code I created which I thought were good enough to release into the wild.

Ribbit
Ribbit is a plugin for the popular Azureus bittorrent client. Ribbit takes advantage of Growl to display notifications like Download Finished.

SimilarTunes
This is my first public Cocoa application. It is a helper tool to create playlists in iTunes based on music similarity. When you enter an artist, SimilarTunes uses different webservices to find similar artists. It then shows a list of all similar artists you actually have in you music library.

Update:
My primary web server is down because of a dsl upgrade, the ISP has shut down all ports. I set up a mirror: Ribbit and SimilarTunes