Copy calculated bpm data from algoriddim djay to iTunes using Applescript

It’s been a long time since I’ve messed with Applescript.

I modified a script I found on the algoriddim forums. This script would run through all tracks that were analyzed in djay and try to write the bpm data to the mp3 tag in iTunes. If your library is large, this could take days.

My modified script will take the currently selected tracks in iTunes and look for bpm data in the djay metadata plist file. Potentially a much smaller and more focused task.

 

[UPDATED 29 Feb 2012] I have included support for manually-set bpm values, which are stored by djay in a separate plist file.

 

[UPDATED 29 Mar 2012] I have included support for copying key data to iTunes, with translation of djay’s integer value to string representation

 

[UPDATED 23 Dec 2012] Bugfix: reset bpm variables in script to prevent old values from being held in memory for the next track. Thanks, Kieron Thorpe!

 

[UPDATED 22 Jan 2013] Bugfix: tracks with a key of 8B-C were being skipped. Thanks, recoltonRobert!
Enhancement: warn user if no tracks are selected in iTunes.

 

Download “Get bpm and key from Djay.scpt”

Solution to “display:table-row” causing pain and suffering with IE

I recently came up against a situation where I wanted to add rows to a table via javascript.

Not a problem with jQuery, EXCEPT that my table rows were being added with ‘style=”display:block”‘.

What’s wrong with that, you ask? Well, in Firefox the row was being appended to the table but it looked all scrunched into the first cell like so:

borkedtablerow

OK, fine. Let’s give it a display property of “table-row.” That should work, right? Yes, it works here but not in IE. IE hates this, in fact. IE wants to get a display of “block.”

The solution turns out to be to set the display value to an empty string. Then, each browser will give the row its default value and everyone is happy.

source: http://cormacscode.wordpress.com/2008/11/28/show-hide-table-row-in-firefox-versus-ie/

Internet Explorer image resizing tip

Who knew?

Though it’s not best practice to resize images in the browser this could really be useful in the right situation:

img { -ms-interpolation-mode: bicubic; }

This little snippet will vastly improve the image resizing abilities of ie — bringing it closer to the resized image quality experienced with Firefox or Safari.

example

[seen at devthought via css-tricks]