Archive for the 'Mac OS X' Category

Using appscript with Mac OS X 10.4 (Tiger)

The Python appscript module brings AppleEvent support into Python, making it possible to communicate with many Mac applications from Python code.

Unfortunately, like many things, it has broken under Tiger.

Fortunately, the fix is easy.

What broke?

The Python install on 10.4 looks for packages in /Library/Python/2.3/site-packages/, where the 10.3 install looks in /Library/Python/2.3/. Appscript Installer 1.01 installs its libraries in /Library/Python/2.3/.

How do you fix it?

Go to /Library/Python/2.3/. Move the following into the site-packages directory:

  • HTMLTemplate.py
  • HTMLTemplate.pyc
  • LaunchServices
  • aem
  • appscript
  • osaterminology
  • osax

That’s it! Now your Python code can once again use appscript.

Tax free day at the Apple Store

It’s busy but they seem to have come up with a nice efficient system for handling the orders. Staff with clipboards are roaming the line, filling out order sheets, and running them to the back room to be put together while the customer waits in line for the register.

They’ve brought in staff from all over the country to help out, too.

Busy as all get-out but not insanity-inducing.

Some useful Mac software tips

Emacs editing keys work in a lot of places in Cocoa apps. Try them in Safari TEXTAREA boxes, or iChat’s text entry area! This is a great feature for me, since those keys are practically hard-wired in my brain. Note that Ctrl-K and Ctrl-Y will in fact Do The Right Thing, and don’t affect the clipboard (but the “kill ring” isn’t implemented, and the “kill buffer” only works within one app).

Somewhere along the way, iTunes got the ability to use Playlist is/is not X as a Smart Playlist criterion, and I didn’t know this until recently. This lets you get Boolean nesting, if you can put up with the intermediate playlists. Now I have a playlist of all the 4-star songs not played in 70 days and all the 5-star songs not played in 14 days, shuffled together. Yay!

Lukas also pointed out that you can use this feature to get a playlist of all the unchecked songs. First, make a playlist of all the songs added after 1901, “limit to checked songs”; then make another playlist, “Playlist is not” the first playlist.