The checkout command works fine, but what I'd like to do now is create an on_pre_save event that looks to see if the file needs to be checked out, pops up a box asking if I'd like to check it out, and does so if I answer yes.

The problem is when I answer no -- is there some way to cancel the save action from within an on_pre_save event?

I got as far as I needed for my purposes -- essentially when you save, it tries to do a checkout if necessary, and then saves.

What it does not do is prompt the user for confirmation or give you the chance to log in. I wasn't too happy with the input options ST2 offered (at the time anyway; haven't explored it since then), so I made myself content with it just using the system credentials if I was already logged in.

The downside is that if my credentials have expired, it just fails to save, but it's easy enough to pop over to the GUI client (or command line) and refresh them.