3

I'm needing to log the time a user spends inside of an application in Mac OS 9. I created a simple bash script "launcher" to do this, but then discovered OS 9 doesn't have bash installed. Here is the bash script I wrote for reference.

#!/bin/bash

APP="TextEdit"  
LOG_LOCATION=~/Desktop/textedit-usage.log

run_app() {
    USER=`whoami`
    START_TIME=`date`
    echo "START - $APP - $USER - $START_TIME" >> $LOG_LOCATION
    Open -W -a $APP
    END_TIME=`date`
    echo "END - $APP - $USER - $END_TIME" >> $LOG_LOCATION
}

run_app &

It creates a simple log file that looks something like this:

START - TextEdit - john - Tue Jan  7 15:14:55 EST 2014
END - TextEdit - john - Tue Jan  7 15:15:48 EST 2014

Is there a way to port this script to OS 9? I was thinking AppleScript might work, but am having trouble finding documentation for the specific version used in OS 9. I don't even know where to start.

  • 2
    That script doesn't say how long you are in an app but how long the app is open. I open several apps on login and don't shut them until logout but I am only using them for a small amount of time – Mark Jan 7 '14 at 22:52
  • 1
    10.9 mavericks or 9 from October, 1999? – bmike Jan 8 '14 at 3:29
  • 1
    9 from October, 1999 – John Jacquay Jan 8 '14 at 15:07
  • @Mark That's true. If you know of a way to only create a log entry when the application is in focus, I would love to hear it. – John Jacquay Jan 8 '14 at 15:11
1

What I would do is install Mac OS X 10.5 Leopard, on a PowerPC PowerMac and then install OS 9 into the Classic Environment, and have your user run their application there. You can still find new and full retail versions of Leopard with the licensing intact, and online support is still available.

Then, I'd use your bash script (with a possibly needed slight modification to track use of the entire Classic Environment rather than the specific application). ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .