I’ll have some news shortly about why my MP3 playlist is showing up on my homepage. For now, just think of it as my way of distracting myself from more serious work.
Category: Scripting
Scripting iTunes
A new script today. No Manila, but it’s a productivity enhancement for my blogging. It grabs the currently playing song from iTunes and drops it into TextEdit. The script is called iTunes2TextEdit, and it’s available from my mac.com homepage.
You need iTunes 2 and MacOS X to run this script. It also works pretty well with TextEdit2Blog, my other script for blogging from TextEdit.
I want to enhance the script to dump in links with the song information automatically, but other than linking to a Google search, I’m not sure where to point the lookups. The Ultimate Band List and IUMA are both hard to navigate from a search standpoint. Why is there no IMDB for information about music?
Currently playing song: “Becuz” by Sonic Youth on Washing Machine.
It’s a Big Scripting Party
Yesterday’s piece on using AppleScript to update a Manila blog interested a lot of people, thanks largely to Dave‘s link to my page. A typical story on my site might accrue 10 hits the first day it’s posted. This one garnered 559. Which leaves open the question: by writing that little script and telling Dave about it, was I just shamelessly whoring for hits? Hopefully a few people downloaded the script and found it worthwhile.
I’d like to issue a public invitation to all the people who are interested in using Apple’s new RPC capabilities with Manila. Let’s have a discussion about what would be the most valuable scripts to write and what would add the most value. I’ll kick it off: I think that (a) automatic spellchecking prior to posting and (b) ability to post image files directly from the Finder to my blog would be great things to have. What do you think?
I’d also like to point out that there are people doing similar things for Blogger. Following my referer links, I just came across this script at Web Entourage. It’s smarter than my script–it uses the selected text from any application. This is cool. I’m learning more about Applescript (I’ll be the first to admit I’m pretty illiterate in it) and about the other people out there who are doing this stuff.
I like the WebEntourage web page better than the page that shows off my script, since he links clearly to the API and to Blogger. I wonder if there could be some way to pull out the links from a Manila message automatically and format them for display somehow, like what Slashdot does.
In non-scripting news…
Today is the fourth anniversary of my wedding to Lisa. We got a lovely e-card yesterday from our dear friend Larry Mueller. I sang with Larry in college and he read at our wedding.
Getting the email from him, I realized it’s been far too long since I spoke with a few of my friends like Larry. Distance is pretty hard to conquer when you’re a student. I think it’s ironic that as my ability to write for my blog has improved, my letter writing skills have diminished.
A long day today. Lots of coursework. I have to keep reminding myself that corporate finance is worth all the trouble.
Blogging in New Places
I write this blog from an unaccustomed place: Apple’s TextEdit application. That I’m doing it from a text processor isn’t in and of itself unusual; normally I write my blog in BBEdit before uploading it to the web. The unusual part is that this blog will be published to the web without my opening a web browser.
This is what I started writing about in July when Apple quietly announced that they would make support for web services–web applications that can be addressed using either XML-RPC or SOAP–available in the operating system and accessible via AppleScript in Mac OS X 10.1. Yesterday I wrote a short AppleScript (available for download) that uses SOAP to call web services belonging to Manila, the publishing system that hosts this blog. The script takes the content of the topmost TextEdit window and makes it a story on my website.
Apple’s made web services pretty darn easy to use. You specify the URL you’re going to and the location of the command you want to use, and the parameters that it takes. You execute the SOAP call. You can call out elements of the resulting XML result by name as though they were normal AppleScript properties (enabling me to get the message number that results when the story is posted).
Le Bien, Le Mal
What’s not to like? Well, sometimes if the script you’re writing doesn’t work, it’s hard to figure out whether you’ve made an error, whether something has gone wrong on the other end, or something else entirely. Case in point: I was getting error messages yesterday from Manila complaining I hadn’t supplied enough parameters to create a message. Had I missed something? Had Dave added something? Then I looked at the XML output (using a great tool from one of Apple’s scripting guys) and realized that the password element had been dropped out. On a little digging, the same Apple guy tipped me off that “password” has a special meaning in AppleScript and I had to treat that property differently (see the script source).
Okay, not perfect, but still having fun. What’s next? How about tying a spellchecker into the workflow? Ease of use capabilities like saving username and blog address, and keychain support, and other applications, and…
I better not get ahead of myself.
Note
The subtitle is taken from Guru’s jazz/hip-hop album, Jazzmatazz. It’s a duet with MC Solaar, French hip-hop artist, in which Solaar basically shows Guru up as a rapper of inferior skills. But I don’t think he knew that when he recorded it. 🙂
Others are Doing It Too
Larry responded to my piece to point out that he’s done this between TextEdit and Blogger. There are probably other people out there doing this too. Let’s have a scripting-our-blog party!