Palm Blogging via ecto

Well, using my limited AppleScript skills, I’ve created a system for blogging via ecto from my palm. Using the MacNoteTaker Conduit, and a Folder Action Script, ecto creates & posts a new post for each new file in the monitored folder. Now all I need to do is ‘fix’ the Conduit so it handles deleted files a bit better. However, since the Conduit was written for a different development environment, I’ll have to get the original working first. Oh, and this post was done directly from my Palm. Well, the paragraph above was, anyway. Bugs to get rid of:

  • Doesn’t do much parsing of the data. Paragraphs don’t seem to exist. Fixed: Used property body text instead of entry body.
  • Use an alternate form of getting the date. MacNoteTaker date-stamps all new files. I’ll use this. Done.
  • Parse the first line to get the post title. Done.

bash .profile not being executed.

Well, a strange thing just started happening - when I start the Terminal (OS X), my ~/.profile is no longer executed. I guess there’s something wrong! I can still just do a source .profile and it runs okay, so there’s no problem there. It is being executed for other users, so it must be an issue with me somewhere! Edit Aha! A quick Google turns up the fact that ~/.profile is not executed if ~/.bash_profile is present. I suspect that the PalmOS development tools installer must have created this file - there was nothing new (for me) in it, so a quick rm ~/.bash_profile fixed my problem.

Welcome to the Mobile World

I bought a Palm the other day. I remember when they were still called Palm Pilots, and I really wanted one then. I was in Officeworks, looking, as I do, through the ‘Soiled & Damaged’ section. I got some half-price DVD+R discs the other day, just because someone had opened the packet and used one. Anyway, I digress. There was a Palm Zire 21 for sale at about 33% off, and I just couldn’t resist. I went home and checked that it would sync well with iCal and Address Book, and became aware of the ‘Mobile Phone’ issue (apparently data loss can occur when a nearby phone rings), but decided to buy it anyway. I’m pretty keen to do some developing on it - I’ve got Python on there, but I want to code a nice database front-end for all of my Touch stuff, that interacts with the Address Book details, and another for Roll marking and Marks Book keeping at school. So, I’m currently funnelling a whole lot of stuff, and will spend a bit of the next holidays coding, I hope.

Flickr Photos

Just as a bit of a test to see how this thing works, I’m posting an image to Flickr, and having it appear here, hopefully.

And while I’m at it, here’s what I’m listening to right now…

To Her Door from the album “Under The Sun” by Paul Kelly

Lately...

I remember a song a guy I went to boarding school with had a cassette single with four versions of a song called Lately. The lyrics were something like:

Lately I’ve seen that look on your face, And you don’t cry anymore. And I just don’t know what to do, anymore. Oh Baby, Oh Baby, I want you here, with me.

Anyway, I’ve never heard the song since, nor been able to find it on the web. But lately I’ve been rather busy with Touch, and haven’t done much coding, other than entries for the New Scientist enigma, and since those ones haven’t been drawn yet, I’m not going to share the answers. I have played around with some new apps, and I’ll list them here:

  • The new version of Ecto, a blogging program is out
  • NewsFire, an RSS Aggregator
  • OmniWeb 5.0, a Web Browser
  • VLC, a movie viewer
  • ManOpen, a man page viewer.

Editing files as super-user

Since one of the security updates, Apple ‘fixed’ open so sudo open wouldn’t run the app as root, but I liked the ability to do this. Instead, one needs to actually run the application (located in ApplicationName.app/Contents/MacOS/ApplicationName) with a sudo. I often need to edit text files, and I use SubEthaEdit. So I put the following lines in my .profile:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
function edit
{
    if test `echo $TERM_PROGRAM` == 'Apple_Terminal' ; then 
      open -a 'SubEthaEdit.app' "$*" &
    else
      pico "$*"
    fi
}

function sedit
{
    if test `echo $TERM_PROGRAM` == 'Apple_Terminal' ; then
      sudo ~/Applications/SubEthaEdit.app/¬
                  Contents/MacOS/SubEthaEdit "$*" &
    else
      sudo pico "$*"
    fi
}

If you don’t mind the prompt not returning until you finish, you can remove the & from the relevant lines. Why the pico lines? (And the test…) Because I sometimes ssh or telnet into my machine, and I like to be able to just type in (s)edit rather than have to remember another command. Other tips I use - change the background colour of SEE to blue for normal use, and another colour, like red/orange for sudo use. That way, you will know when you are editing a file as a superuser. You will need to sedit first to go through the ‘initial use agreement’. You could also use this trick with another editor…like pico…:-)

Baby Jack

I guess I forgot to blog about my new nephew, since it all happened so fast. My sister was due to give birth at the end of August. It happened instead at the start of July. Jack Hamilton Lewis was born (8 weeks early) on July 3rd, 2004. He was a little under 5lbs. My brother in law (who is significantly larger than anyone in my family) suggested there wasn’t enough room inside for him anymore. So, he was a bit early, lungs not quite ready yet, and was flown to Royal Women’s Hospital in Melbourne. Where he stayed for a couple of weeks, before returning to Warrnambool, and then Hamilton. No-one was expecting him to be ready to go home until about his original due date, but he’s home now, and doing well. Jaq & I (yes, it seems he was named after her!) raced over to Melbourne to see them, and he looks just like Dad!

Walking Home Drunk Simulator

Funniest thing I’ve seen. Ever.

Choose My Music

Just surfing around, I found this site. Some guy has set up his computer so that you can choose songs to cue up on his system. I might just have to try something similar with my Xbox…

Export Artwork and Playlists

Exporting Artwork

Seeing as how XBMC won’t read the id3 tags from AAC files, I had to grab the artwork from each album and place it in a file (folder.jpg/folder.png) inside the album folder. This was actually easier with Windows (aargh!), since iTunes for Windows exports album art as BMP files, which can then be processed. Still, it took me most of the afternoon to do that by hand. I had had a bash at doing it with an AppleScript, but could not work out how to get the data from a <<class PNG/JPEG *>> structure into an image file. Until I came across a script that does that. It was then a trivial matter to make it so that it worked for multiple files, and only processed those files it needed to, and ignored those without artwork. Tip: iTunes will give you an Out Of Memory Error if you try to get the data from a song that has no artworks! (Took me a while to figure this out!) So, the finished script can be found below. I optimised it a bit, but it still takes a while to run, especially if you run it on lots of tracks. Since it’s not something you’ll want to run every day, this shouldn’t be too much of a problem.

Exporting Playlists

I also thought it would be neat to get the playlists I use in iTunes (I use mostly smart playlists, such as 50’s - 00’s Music, Not Played Today, Recently Added and so on), and use them on XBMC. So, I wrote a script that does this, and then ftp’s the resulting files to the xbox. You will need to edit the first few lines: it should be obvious what needs to go where. Anyway, you can download Export Artwork and Export Playlists. You can also download Bracket Change, a small script that swaps the round & square brackets in a track name. (Right-click and choose to download them, else they will just open in your browser window). All of these files should go into ~/Library/iTunes/Scripts (User only) or /Library/iTunes/Scripts (System-wide) for best effect. Note: The first Script is no longer required, since more recent builds of XBMC can handle the data from AAC files.