Address Book Scripting

I’m trying to save time by creating some simple scripts to add values to Address Book entries. For instance, I have a whole lot of people in a group who are living in the same state, and I want to add this to all addresses. However, it doesn’t seem to be possible to get or set the state of an address:

1
2
3
4
5
    tell application "Address Book"
    	tell my card
    		set the_state to state of address 1
    	end tell
    end tell

This fails. With the very helpful:

Address Book got an error: Can’t make state of address 1 of my card into type reference.

Which means absolutely nothing, as far as I can tell. Googling this string brings no joy. Now the weird thing is that if I switch over to another user, it works fine. Update: I quit all running Apps (with the intention of restarting, but System Update stopped me) and retried it. It worked. Something I was running was interfering with it, but I have no idea what.

Category Pages

I want to add some functionality to my site. I used to just have a few categories, but as I wrote more, I wanted to sub-categorize a bit. So now, I have a handful of parent categories, and under (most of) these I have one or more child categories. In some cases this goes three or four deep. But, so the category list isn’t too long, I only show the parent categories in the sidebar. What I want is that when a category page is shown, at the top is a list of the child categories. I can (relatively) easily find out if I am viewing a category page: {if $smarty.server.REQUEST_URI|truncate:10::1 == '/category/'} I can also quite easily find the name of the category, but not the id. This is what I need for creating the category list. I’ve just had a thought. Checks something. The following displays the info that is sent to the server: {foreach from=$smarty.server.argv item=var} {$var} {/foreach} I was hoping it would give the category id. But it doesn’t, only the name. Back to the drawing board.

Return to Men's

Well, first game back in Men’s A Grade, and a fair start it was too. Playing with a about 4-5 guys I’ve coached, and two I’ve actually played with, along with a whole host of new guys (including one playing his first game!), it was, as always, a little slow to start. New teams generally tak e while to iron out all of the bugs. About level with Diamontec at half time, we drew away from them in the second half. Lacking fitness, I had to rely on skill (that’s a dangerous choice!), and managed to post home a couple of touchdowns myself. The last of which was really only because Paul and Hully wrapped around me, but the nice little fake settled it. The nicest thing is that after a 6-2 victory, we are top of the ladder! No Dumps next week, at 6:15. Should be a bit more challenging, I’d say…

(Legitimate) Mass Email

I’m in a situation where I need to send out large numbers of emails - now, settle down, I’m not talking Spam! Rather, I am the _Member Communication/Liason Officer _for a sporting organisation, and need to send many emails out to either a subset of the community, or in some cases, the whole community. I’m thinking about different methods to streamline my communication processes. I think I have a few options: Mail.app and Address Book. Using the Groups feature of Address Book, I can send out emails to the right combination of people who need to receive them. For instance, I can have a Men’s Open group, a Women’s Open group, a Juniors group (not really required anymore), a coaches group, a committee group and so on. This should work pretty well, but will require me to have all of the up-to-date information in Address Book. Not necessarily a bad thing, but I need to ensure that Word/Excel can use this as a source (we have some custom generated forms that need to be populated), or custom-generate some sort of interface solution. Perhaps I should add extra fields to Address Book, and use that as my database. The other option is to go the whole hog and create a Database (MySQL, or something similar) that I can use to store the data in. Ideally I’d like to have an online one, as then I can access it from work if I need to. Otherwise, I’ll only be able to send out emails and so on when at home. That is the big disadvantage of the first solution. The other possible disadvantage of this method is that with a large number of emails, I may look like a Spammer. Which brings me to the other option - a dedicated mass-emailer. Of course, this itself may make me look like a Spammer - emails may be rejected just because they use a particular X-Mailer: header, or something strange like that. A better solution might be to custom-roll an AppleScript solution that generates individual emails from a list. This could be a goer. Kind of like a Mail-Merge, but and Email-Merge. I’d like to be able to do this as an Apple Mail plugin, but a stand-alone app might be easier. Then I can write it in AppleScript Studio. I’m liking the sound of this: extend Address Book so it has (for instance) Coach, Referee and Selector fields (for an indication of NCAS/ATA Accreditation level) and so on, and combine this with some fancy AppleScripting to allow for personalised emails, and generation of reports. Next week, maybe. When I’ve finished writing all of the Year 12 SARs.

More on the Melbourne Cup

Google.Oz (in reality, google.com.au) has a special Melbourne Cup image: After my last rantpost, this bugs me too.

On Horse Racing

I’ve never understood the fascination Australians have with horse racing in general, and the Melbourne Cup specifically. Mind you, I’m not a real big fan of motor racing for that matter either. Anyway, back to “the sport of kings.” My sister is a Vet, and races Pacers (which, I just learned a week or so ago, are different to Trotters), and obviously she and her husband are kind-of into horse racing. Whenever I’ve been out drinking and horse racing has been happening, (like at Dan’s bucks night, and Sam’s bucks night, and so on) I’ll ring Tish and ask her for a tip. Either she doesn’t have good tips for normal horse racing, or just likes feeding me duds, as none of them have ever come in. Back when I was teaching swimming lessons we used to have lunch at the pub every day, and have a bet or two on the horsies, but I was never really that into it. When we go to the easter races at Oakbank I’ll follow Marion’s tips, but that’s only because they tend to win. I think that’s what it comes down to. I don’t mind doing it when I win, but I think I’m realistic enough to understand that I’m not going to win in the long run, and don’t even consider putting a large bet on, even if there’s a chance to make a lot of money. I just don’t have enough of a gambler’s streak for that to be an appealing option. I’m not really into gambling at all, come to think of it. Pokies seem like a waste of time - I’d rather put my money into a video game machine where you get to shoot stuff, rather then just push buttons and rely on dumb luck. Maybe it helps that I’ve never really won any money in gambling. Perhaps if I’d won a bit on my first time, I might have become a gambler. Maybe not. Even when we went to the pub in Sydney a year or so ago, Andy and Dan played the pokies - I played ‘Big Deer Hunter’. One of the other guys won some serious money. I wasn’t jealous at all - I knew I probably wouldn’t have. Moving onto a related topic, I was watching Episode 5 of Lost Season 2 last night - the episode where Hurley remembers winning the lotto, and how his friend basically became jealous of him, and just walked away. I don’t know that I’d be jealous of someone else winning millions of dollars in the lotto. I guess because I’d never enter it myself, I like to think I’d feel happy for them. Back onto horse (and motor) racing. I fail to identify these as sports. Sport is about major physical activity. Fitness and the like. Which these, IMHO aren’t. Reminds me: I’m making my Men’s Open Touch comeback tonight. I wish I was fit.

JavaScript in Posts

Clearly, this is the first time I’ve tried to do this. No, that’s not quote true. I’ve been working on a post that does it, I just haven’t published it yet. I’ve discovered that JavaScript is really neat for doing lots of cool stuff. However, WordPress has a couple of issues with it. It’s okay to use JavaScript in template files, or include external JavaScripts, and even to use JavaScript in Pages, but if you try to use it in Posts, it fails. It converts " into ", and ’ into '. Or more strictly, into the #8220;-ish version. Which isn’t much good, as then any JavaScript which uses quotes, to define a string, for instance, will not work. You could define a function elsewhere, and then just call it, that should work. But not do anything that requires quotes. There seem to be a couple of WordPress workarounds, but not in WordPress-MU. Or Blogsome, that means. I may have a look at the source, to see if I can figure out a way to make it work nicer. Oh, and that reminds me. I need a decent text editor for Windows. Notepad just ain’t cutting it anymore. Especially if I try to open a Unix file.

What the... ?

Tried to shut down the other night, got this interesting dialog: At least I knew what button to click on!

PostSecret Again

These three caught my fancy. Not that I fancy any student’s parents. Or could keep a student back. Or find teens sexy. Or play cello. But funny nonetheless.

Floor Finished!

Simon breated me for not posting any house pictures lately, so here you go. We finished replacing all of the floorboards yesterday. Looks pretty good too. There were a couple of issues where the edging was - particularly the part where the lounge meets the dining room (but we’ll be using it as a study).