How many languages does it take to change a Keynote slide?

30 Sep, 2007 — Apple, Design & Usability, Funny, Thoughts

I was playing with Telekinesis on Friday, which lets you use an iPhone as a remote control for your Mac. The idea is simple: Telekinesis runs a web server on your machine, and the iPhone connects to it. It ships with a few Telekinesis Applications (or “tapps”), or you can write your own to control your own programs.

I wrote one to control Keynote presentations from your iPhone. It’s fairly simple: it shows you the current slide and the presenter’s notes for that slide, and it lets you go forward and backward through your slide deck. (No, it’s not release-quality yet, but expect it in a few days.)

So here’s the real meat of this blog post: (Warning: geeky-acronym-land ahead.)

  • Being a Mac OS X app, Telekinesis’s UI is written in Objective C.
  • It exposes a web server that can run PHP scripts.
  • My remote application is a set of PHP scripts that sit on the Mac and run when the iPhone user launches the app.
  • On the iPhone, the user makes a request to the PHP script, that generates HTML, CSS and JavaScript to format the page for the iPhone
  • To capture the current slide, I use a command line program (screencapture) inside a shell script from within PHP.
  • I resize the large slide for the iPhone using another shell script, and push it out to the phone as a stream of bytes, via PHP.
  • To change slides, the user clicks the Next and Previous functions on the iPhone, which use AJAX (JavaScript, XML, XmlHttpRequest) to send the request to a PHP script;
  • the PHP script interprets this request, and wants to use AppleScript to ask Keynote to update the current slide. But since there is no direct way to invoke AppleScript from PHP, we use the command-line tool osascript in a shell script to run our AppleScript.
  • Keynote hears the call to action from our AppleScript, and changes the slide.

So, our champion team now includes the following players: Objective C, PHP, HTML, CSS, JavaScript, Shell Script, and AppleScript: all with the single goal of changing a Keynote slide.

Has anyone changed lightbulbs with an iPhone yet?

Timezone issues in Google Calendar widget fixed. Or so I think. Maybe.

Lots of you reported timezone errors in my Google Calendar Dashboard Widget. I thought I’d fixed it in 2.0 with some changes to the date parsing code, but it turned out that only worked for certain timezones. So here is another version with solely a timezone bug fix. I believe this should be the end of all troubles, but who knows.

Go forth, download v2.1, and let me know how it goes! If you still encounter any issues, please let me know.

If you’re a programmer, you might appreciate knowing what was wrong: the JavaScript parseInt function expects a radix as its second argument. (Radix is the base to which numbers should be parsed, e.g. decimal, octal or hex.) If you don’t provide a radix, the function guesses a radix based on the string you pass to it. If the number starts with 1-9, then the radix is assumed to be 10; if it’s 01-09, then it’s octal, and 001-009 are parsed as hex. So the timezone parsing was being affected by this for all the 01-09 hours of difference. Long story short, I added the radix explicitly, and things should be OK now.

Google Calendar Dashboard Widget Updated to version 2.0

15 Feb, 2007 — Apple, Google, Release

This long-pending update to my Google Calendar Dashboard Widget is now finally ready!

Changes in Version 2.0

  1. There were some problems handling time-zones in version 1.0 for some users. These issues have been (hopefully!) fixed in version 2.0.
  2. A highly-requested feature was to be able to look-ahead several days into the future, not just today and tomorrow’s events. Version 2.0 lets you preview up to one week ahead of today.
  3. The top part of the widget now features a button that takes you to Google Calendar in a browser. Trivial, yet highly useful, feature.

Download this free update if you’re using version 1.0. And keep the comments flowing in!

Related posts: Announcing the Google Calendar Dashboard Widget.

Plays? For Sure? No, Really?

6 Nov, 2006 — Apple, Microsoft, Sightings, Stupid

Users who bought music from Microsoft’s MSN Music Store (no one I know, but still) will not be able to play it on the newly-announced Zune portable player. (Oh, did I mention Zune is made by Microsoft too?)

Let’s see how many different classes of people they’ve alienated this time:

  1. There are the users who bought players from their hardware partners. If they want to “upgrade” to a Zune, they’ll have to re-buy their music.
  2. Their hardware partners, because this is going to affect their sales, no doubt.
  3. Their music suppliers, because they’re discontinuing the MSN Store.
  4. And this is in addition to all of us Mac OS X and Linux users for whom Microsoft doesn’t even have a media player (not that we care, but still.)

From playsforsure.com:

Look for the PlaysForSure logo if you’re shopping for a music or video device and you want to make sure the digital music and video you purchase will play back on it every time.

Heh. I’d just buy an iPod, then. :)

And the irony to top it all is that this initiative was called ‘Plays for Sure’. Yeah, right.

Announcing the Google Calendar Dashboard Widget

In the tradition of writing gadgets for Google Desktop and other Google properties, here’s one more from me: the Google Calendar Widget for Mac OS X Dashboard.

Since my switch to the Mac, I’ve been missing Google Desktop and using Dashboard more and more. And a calendar’s a nice thing to keep an eye on from time to time. So, without much further ado, here’s the gadget, oops, widget!

Google Calendar Dashboard Widget Screenshot

« Previous PageNext Page »