Scripts and Software

Posted by toj8j@alumni.virginia.edu, 11/8/01 at 11:03:38 PM.

This page contains my software and my AppleScripts. I like AppleScript. Why? Because there are lots of apps that do really cool things that could do them even better if they could talk to each other while they do it. Or to something on the Internet.

I also like other programming environments, like AppleScript Studio, and this page will also feature things I've written using other environments. My first app in this category is Manila Envelope.

Applications

Application Description Published Revised In My Blog
Manila Envelope Native, simple Mac OS X app that allows posting to your weblog without a browser. Source; news. 17-Jan-2002 14-Oct-2002
(v.1.0.3a)
Blogging and AppleScript Studio

Scripts

Script Description Published Revised In My Blog
TextEdit2Blog Post to a Manila blog from TextEdit in MacOS X 10.1. 05-Oct-2001 15-Nov-2001
(v.1.2)
Blogging in New Places
iTunes2TextEdit Write info about your currently playing iTunes 2 track to TextEdit. 08-Nov-2001 Scripting iTunes
iTunes2Manila Automatically upload your currently playing iTunes song to your weblog as a News Item. 12-Nov-2001 08-Oct-2002
(v.1.0.3)
TextEdit2ManilaNews Post from TextEdit to a Manila News Item. Requires ManilaHandler. 15-Nov-2001 Nov 15, 2001
OmniOutliner2OPML Export an OmniOutliner document to OPML. Tested with OmniOutliner 2.0 beta. 15-Mar-2002 19-Mar-2002
v.1.0.2
Mar 15,2002
Look Up Current Track in Amazon Look up the currently playing iTunes track in Amazon and display details. Requires AmazonHandler and SOAPXMLRPCHandler. 28-Jun-2003 v.1.0a1 Jun 28,2003
massDeleteManila Delete a batch of Manila messages by message ID. Requires ManilaHandler (included). 24-Jul-2005 v.1.0 Jul 25, 2005
Increment Playcount Bump the playcount of an iTunes item by 1. Requires a version of iTunes for which playcount is writable (post-iTunes 4). 04-Jan-2006 v.1.0 Jan 4, 2006

Script Libraries

Script Description Published Revised In My Blog
AmazonHandler Support library to access the Amazon Web Services API. Requires the SOAPXMLRPCHandler script. 19-Jul-2002 19-Jul-2002
ManilaHandler Support library needed for several of my Manila scripts. Requires the SOAPXMLRPCHandler script. 12-Nov-2001 08-Oct-2002
(v.1.1.1)
Nov 12, 2001
SOAPXMLRPCHandler Support library needed for several of my scripts to make SOAP calls. 12-Nov-2001 08-Oct-2002
(v.1.1.1)

topicScripting:

News Items about Scripting

The list of news items that I've written about scripting can be accessed here.

Most Recent News Items

New iTunes script: Increment Playcount

I’ve uploaded a bare bones AppleScript that I’ve found useful over the past few weeks. The script, Increment Playcount, does what it says: it bumps the playcount of a track in iTunes by 1 and sets the Last Played date to the current date and time. It’s been helpful to me because many of my smart playlists rely on knowing if I’ve heard a track or not, but unfortunately sometimes my iPod doesn’t sync playcounts—and sometimes my iTunes library gets blown away, losing all playcount information.

To use the script, unzip it, drop the script in your Library/iTunes/Scripts folder, go to iTunes, select one or more tracks, then select Increment Playcount from the scripts menu.

More detail about this and my other AppleScripts on my Software page.

massDeleteManila: AppleScript for mass spam deletion

After the carpal tunnel moment earlier today, I decided to look on the bright side of spam. I updated my hoary old ManilaHandler AppleScript to add support for the Manila.message.delete method (and at the same time bundled the support script SOAPXMLRPCHandler into the body of the script). And I wrote a simple AppleScript, massDeleteManila, that takes a comma delimited list of message IDs and deletes them.

The UI isn’t elegant. You need to type or paste a comma delimited list into a dialog box. Plus no progress bar. But it works, and it is a lot faster than deleting spam through the web UI.

My suggested workflow for using this on your own Manila blog:

  1. Copy and paste the table for your discussion group topic listing page showing the spam messages into Excel.
  2. Copy just the message IDs and paste them into BBEdit (or another word processor).
  3. Search and replace: replace paragraphs with commas.
  4. Run the massDeleteManila script and paste the comma-delimited list of message IDs into the first dialog box.
  5. If you haven’t filled out your blog URL yet, type it in, along with your username and password.
  6. The script runs silently until all the messages have been deleted.

The massDeleteManila script is available for download. I provide it so that other Manila users, such as the Berkman bloggers, can benefit. Please use it carefully—there’s no easy way to undelete messages in Manila, and I cannot provide support if you accidentally delete important content. Note that you may need Tiger to run the script—I haven’t been able to test it under Panther.

In defense of plain ol’ SQL

Philip Greenspun Weblog: How long is the average Internet discussion forum posting?. I’m less interested in Philip’s answer than I am in the methodology: simple SQL select statements that give you very important product design data.

People talk about “data mining” and “business intelligence” as though they’re complicated, new skill sets, but really all you need sometimes to make the right call is a simple SQL query. And the right data set, of course…

Integrating Google Maps

Mac OS X Hints: Map Address Book addresses via Google Maps. This is the sort of low tech URL-based hack that is perfect for AppleScript, and very easy to debug.

An older Mac OS X Hints article discusses the plug-in capability and provides another sample script. From that, it looks like you capture the field to which you’re adding the contextual menu using an “on action property” handler; the title can be set with “on action title”; and the actual code is in the “on perform action” block.

Other address book plug-ins:

  • iCal Scripts (Apple): schedule a call, create a “birthday event” (reminder), or create an event associated with the person
  • Dates and SMS Scripts (Daniel Browne): send an SMS message via a Bluetooth phone, email, or AIM
  • Skype call (bertlmike): open a Skype call

The plug-ins can also be written in Cocoa or Carbon.

Hmm…

First Panther note: some of my scripts don’t seem to work under Mac OS X 10.3. Specifically, Look Up Current Track in iTunes doesn’t work and iTunes2Manila fails because it can’t connect to the Internet. Wonder if Apple changed how SOAP calls work…

Update: Changed or more precisely broke, it looks like, based on evidence from this MacScripter thread. Stay tuned...

[Discuss]

Last updated Wednesday, January 4, 2006 at 7:37:16 PM.

Here's the print-friendly version of this page.

Mail This Story