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    tell application "Address Book"
2    	tell my card
3    		set the_state to state of address 1
4    	end tell
5    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…