photo and applescript for situps

as has become my habit on days I have something to say: first the photo of the day, then the content.

today I crossed over to the dark side and wrote an applescript.

I feel like I have betrayed my perl roots, it's possible that I'll rewrite this in perl next week but I wanted to give applescript a try.

Jenna was forced by an injury to stop running with me in the Couch to 5k http://www.coolrunning.com/engine/2/2_3/181.shtml training so until she can run again we've started the 2 Hundred Situps training program http://www.twohundredsitups.com/ .

The big problem with this, aside from the fact that it is even more boring than running, is that you have to keep count. It makes it all very confusing for two people to try to do together.

So, I've written a small applescript to do the counting for us. When it runs, it asks you to pick a voice for the general prompts and situp number, and another for counting the 3 seconds you're supposed to hold each crunch for. It then asks for the number in each of the 4 sets that makeup each day's training.

Once it gets the input it needs, it gives you 30 seconds to get into place and starts counting, with a 30 second break between sets, and a final set of 200 where the idea is that you do as many as you can and then stop and record that day's final numbers in your training log.

I've attached the script in compiled and source code formats to the bottom of this post, let me know if this is useful for you or if you want to help port this to other languages to it can run on linux as well (next step for me is to research how to trigger a text to speech function in linux from perl).

The following web pages were critical in helping me figure out certain parts of this.

simple repeat loops: http://www.mactech.com/articles/mactech/Vol.20/20.12/RepeatLoops/index.html

how to display the menus for selecting the voice to use: http://www.devdaily.com/blog/post/mac-os-x/displaying-list-in-dialog-usi...

declaration and modification of variables: http://www.acm.uiuc.edu/iCal/workshops/applescript/1996/2_loopingNvariab...

AttachmentSize
situp robot source code5.14 KB
situp robot script editor file25.12 KB
situp robot stand alone application13.46 KB

pushups!

I highly recommend 100 pushups, too. I didn't used to be able to do more than 2 or 3. I'm not sure where my max is now, but I got to around 30 and it started to take too long. Now I do 20 most days, 40 some days, and I am super aware of the other things I can do more comfortably with a stronger core (like press headstands, which are just showy, but eluded me for a long, long time).