14/12/2009
I noticed that my little app for migrating your data from Things to The Hit List still gets some hits. I haven’t really looked at it for ages, but I wasn’t terribly surprised to see that it’s broken under Snow Leopard.
I decided to fix it, expecting AppleScript projects in Xcode to work pretty much the same that they did before, and brother was I mistaken.
It seems that Apple decided AppleScript as a simple to grasp scripting language really has no place in Xcode anymore, and Cocoafied the bejeezus out of it. On the surface using the new Cocoa / AppleScript bridge feels like playing a nazi in most hollywood war movies. You’re still speaking English (Cocoa), just with a horrible German (AppleScript) accent.
The Migrator is just a little quick and dirty utility app, which AppleScript is perfect for, but rewriting this for 10.6 I felt I might as well have ported it to Cocoa (since I’m in the process of learning Objective C anyway). I didn’t though. I hacked my way through it using the Bridge, and I felt like Xcode was berating me the whole time.
I’m excited about Cocoa and Objective-C, but I loved AppleScript for what it was. I’m still going to be using AppleScript a lot, but unless I “See the light” of the Cocoa Bridge, I don’t think I’ll be making any GUI apps with it anymore. I also find it telling that there seems to be no documentation for the Cocoa / AppleScript Bridge except for the release notes that I can find.
Rant over.
Disclaimer:
- This works fine for me. I make no guarantees that it’ll work for you. I think it will, and I’ll try to help you out if it doesn’t, but I’m not liable if your Mac explodes.
- Caution: If you check the “Delete items from Things” option your items will be deleted from Things.
- In order for this to work the app will empty your Things trash can regardless. If you really need the stuff in the Things trash can, perhaps it shouldn’t be in the trash.
- I don’t have a Leopard machine handy, so I haven’t tested the Leopard version since I first posted it in May. It worked then, so it should work now.
Github
App – Leopard
Source Code – Leopard
App – Snow Leopard
Source Code – Snow Leopard
14/05/2009
Edit: I updated the app to work on Snow Leopard. Go here to get the app or source code.
So this all started out with me pining for the release of the fabled iPhone version of The Hit List. I started out just wanting to create a script that would let me use Things Touch to gather tasks when I was out and about and then transfer them to The Hit List and delete them from things. Seeing how I already had a license for Things this seemed to be my best option for the time being. (Sorry Appigo Todo. It’s not you, it’s me.)
So this is all just exposition, because:
1. It’s too klugey a way of going about this to actually be useful
And 2. it’s easier to achieve almost as good a result by just syncing through iCal.
So now I’m sitting here with a heap of useless code and decided to see if I could repurpose it to do some good.
I present to you the Things Migrator. This is a small app that does one thing only. It grabs all of your to-dos from Things and migrates them over to The Hit List.
Now, not all of the same metaphors apply in The Hit List as they do in Things, so some of the data will inevitably be lost or confuddled. Below is a short summary of how the migrator will treat the different kinds of data.
Tags are transformed into /Tags or /Multi word tags/, Projects become Lists and you can map Areas into /Tags, /Area name tags/ or @contexts.
Issues that may or may not be improved upon:
- It’ll only migrate open tasks and it’ll ignore Things’ “activation date”, “creation date”, and pretty much anything to do with “per sons”.
- Links to local files will not be read. I can’t figure out how to decode the stupid HEX-string I get into a proper path. Instead the script will insert a note alerting you to the fact that somehting’s missing.
- URL links will for now show up as the full HTML link, i.e. <a href="http://ctrloptcmd.com">my link</a>. I’m sure it’s easily fixable, but it’ll have to wait until I know if anyone at all wants it seeing how this string parsing in AppleScript is getting on my balls.
- It is, as mentioned before, a one way street. There’s no syncing back to Things from THL per now, and I don’t know if there ever will.
Please note that this is experimental stuff and I take no responsibility for crap that may happen!
That said, it seems to work pretty well and you can download the application (with a nice GUI) or the full XCode project here.
Comments and feedback is always appreciated.
6/03/2009
How’s that for a TitleCased title?
So I’ve been checking out Path Finder again. The thing with Path Finder is that it’s very nearly awesome, but there are a few things that bug the hell out of me. I may or may not come back to the most irritating shortcomings in a later post, but I’m going to address one of the main issues straight away; Path Finder has crappy support for AppleScript.
I love that little quirky language that actually gives me loads of control over the OS, but for some reason you can’t just rewrite your old AppleScripts to do a check for the current “Finder app” and react upon it with the same code. I have no idea why porting the Finder Dictionary to the Path Finder Dictionary is so hard (if I did I’d be writing some way cooler code than I currently am) but it bugs the hell out of me when some of my most frequently used scripts won’t work anymore. It’s like sitting down on a Mac that hasn’t got Quicksilver installed. You feel like you’re typing with boxing gloves.
Therefore I’ve set out to port my most crucial scripts so they’ll work whether I’m in Finder or Path Finder.
Read the rest of this article »
9/01/2009
I use a 15″ MacBook Pro that I carry between work and home. At work I have a 30″ Cinema Display which means I can actually have half of the Flash IDE showing at once. Mostly it’s plug and play but every once in a while some app just doesn’t realize that I’ve unplugged the huge display and some window ends up at some awkward position where I have to drag it out and resize it, or even worse; It ends up outside the boundaries of the laptop screen altogether.
AppleScript to the rescue. Copy this script and save it into your AppleScripts folder. You can assign it to a Quicksilver hotkey if you’d like, but I find it’s convenient enough to just launch it from Quicksilver in the usual manner.
What it does is simply resizing the window and centering it on the display. There are more elegant ways to do this, but this one works even with apps that have little or no support for AppleScript at all. You can adjust the lines:
1 2
| set position to {220, 50}
set size to {1000, 800} |
to fit your screen real estate as those values are set to center on a 1440 / 900 display.
1 2 3 4 5 6 7 8 9 10
| tell application "System Events"
set frontmostProcess to name of first item of ¬
(processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set position to {100, 0}
set size to {1200, 800}
end tell
end tell
end tell |
9/12/2008

Just encountered bliss deep down in the Quicksilver Google Groups forum. I was trying to save myself a keystroke as usual. More specifically; I often open folders and files in TextMate, and the steps for doing so with Quicksilver are
- 1: Type the first few letters of the folder/file.
- 2: Tab over to the next pane and type “wi” to bring up “Open with” instead of “Open”.
- 3: Tab over to once more and type “te” to bring up TextMate.
- 4: Hit return.
Which is, I suppose, not too bad. However I wanted the flow to be more like this:
- 1: Find the folder/file
- 2: Type in “wi” to bring up a custom action to open the file in TextMate.
- 3: Hit return.
No, it’s not a major step but every single keystroke matters. And besides; This specific action isn’t really the point here.
The point is that to my amazement there wasn’t any simple way to assign a abbreviation to this type of action. That is; an action that needs input in more than one pane. Being a stubborn bastard I started sniffing around on how I could create my own Quicksilver plugin to perform this seemingly simple task. It seemed however that to create a Quicksilver plugin the way to go was Objective-C which I don’t know (the books are shipping from Amazon as we speak). I sat down to make a go at it in XCode, but I just had to give up before I broke something.
Then; Severely undocumented for such a wonderful feature, it turns out that Quicksilver commands can be written in AppleScript. I don’t mean the fact that you can run AppleScripts from Quicksilver, although that’s nice as well. You can actually create commands that’ll behave just like the native commands in Quicksilver, such as “Reveal”, “Copy to…” or “Go to path in Terminal”. With AppleScript being a ridiculously easy language to get started with , this is huge news.
It means that instead of getting to grips with the intimidating world of XCode, my problem could be solved in four human-readable lines:
1 2 3 4
| on open these_items
tell application "TextMate" to open these_items
tell application "TextMate" to activate
end open |
The trick is in the opening line
refers to the current selection in the first pane, and after that you can use the variable
to manipulate with AppleScript all you want. When you’re happy with your script, copy it to ~/Library/Application Support/Quicksilver/Actions and restart Quicksilver. You might also want to go into the Quicksilver preferences and give it a higher priority, or alternatively assign it to an abbreviation.
Have fun!