Plazes: ecto Applescript, Dashboard widget

Regular readers will already know that I’m a big fan of Plazes. It is a service which, I think, deserves to have taken off more quickly.

The default Plazer application already integrates nicely with iChat, and will set my status to my current location. You can also get Applescripts that will enable other applications to do the same, for example Adium.

Last night, in a fit of interest, I hacked together my first ever Applescript. I recently read an article that described Applescript as “a hidden jewel in Apple’s crown”, and I have to say I was impressed. The blogging client I’m using, ecto, is scriptable – although I didn’t have anything to work from until I realised that the disk image had come with a bunch of example scripts, which I hastily installed for reference.

Making an XML-RPC call in Applescript is remarkably easy, and it was really simple to get hold of my current location – I used the Adium/Plazes script as an example, but the overall simplicity of the call really impressed me. After that, it was a straightforward matter of using an existing script that added text to the current draft to drop the location details into the post, and voila. The end of this post should demonstrate the capability.

I’ve uploaded the Applescript here.

  1. Open the script in a text editor.
  2. You will need to edit the script to put your Plazes username and password at the top. It will not work if you don’t do this.
  3. If you wish to change the text that the script adds to a post, alter the contents of the _text variable about three quarters of the way down (be careful though).
  4. Once you’ve made the changes, paste the script into the Script Editor and save it as Plazes.scpt, with a file format of script. The Script Editor should syntax highlight it all once it has been successfully saved as a script. Quit the Script Editor afterwards.
  5. Move the script to ~/Library/Application Support/ecto/Scripts.
  6. In ecto, choose Scripts->Plazes from the menu, and your location should appear in your current draft.

There’s one slightly frustrating feature of ecto – it apparently refuses to recognise the font-size style on the <p> tag and replaces it with lots of <span>s, and also replaces 10px with 10pt – not quite sure why that is yet.

Moving on from ecto, another interesting Plazes tool I’ve found is a Dashboard widget that displays a Google Map of your current location, and lets you find your contacts online. It is a bit rough around the edges, but I’ve been playing around with Apple’s new Dashcode tool and have tried making tweaks… I’ve dropped the author a line and hopefully he’ll want to resurrect it.

Posted whilst at White Leaf House [ plazes.com ]

Technorati Tags: , , , , , , , , , , ,

8 thoughts on “Plazes: ecto Applescript, Dashboard widget”

  1. Hey Andy

    Nice that you noticed my widget. I don’t use Dashboard anymore, it’s just way too slow. I had meant to improve the widget some more and add nicer graphics, but never got around to it.

    You’re welcome to take the widget, change it and republish it. I think Creative Commons Attribution should be an appropriate license.

  2. Thanks – I’ll probably continue to play around with it, although I’m not sure how much I’ll actually do, it’s an exercise in learning how Dashboard works as much as anything else. I’ll be sure to let you know if I do republish anything, and obviously credit you as per the license.

  3. Very neat – now I wish ecto supported adding additional metadata to the XML-RPC so you could properly post your location to blogs supporting GeoRSS/XML-RPC like GeoPress.

    Then you could actually store the location in the database and make your own maps or find all posts at a location as determined by your Plazes account.

  4. Sounds like a request for Adriaan in ecto 3 – although actually since it is the Applescript that is doing the XML-RPC it should be possible anyway.

    Can you give me a more detailed example? I don’t use those services.

Leave a Reply