Start Routine At Login

October 19th, 2006

Luis over at Happy Apps is heavy in to the FlexTime habit, and asked me if I would consider adding a feature such that routines would automatically start as soon as they are opened. Why? Because he uses his FlexTime “break reminder” routine every day, and has FlexTime set to open up as part of his “Login Items” list. But he still has to remember to click the “Run” button before he gets started with his work.

I think some kind of “auto-start” idea is good, but I suggested a workaround that should work in the mean-time. By using FlexTime’s scripting mechanism to both open and start a routine, anybody can build a “routine starter” applet and keep it handy for this type of use.

Open Script Editor, and paste in the following script:

tell application "FlexTime"
  open "/Users/daniel/Documents/Break Reminder.flextime" as POSIX file
  set running of document 1 to true
end tell

You’ll have to edit the path to match the routine you want to run, of course. Now select “Save As” from the File menu in Script Editor, and select “Application Bundle” from the File Format popup menu:

Save the script application wherever you like. For instance, you could just pop it into your applications folder.

Now open up Login Items from the “Accounts” pane in System Preferences. Drag the resulting script application right into the list:

Now whenever you login in to your computer, the selected routine will start automatically. If you want to start several routines at once, just edit the script to add more “open” and “set running of document 1″ lines.

This same technique can be used to add “Routine Starters” to the sidebar in the Finder, or the Dock. Just drag the resulting script application in and it will always be available to you.

2 Responses to “Start Routine At Login”

  1. Mike Abdullah Says:

    Interesting. In a way this reminds a little of how AppleScripts behave.

    If you double-click a script in the Finder it opens in Script Editor rather than running it. If you launch it from a menu, the script actually runs.

    Slightly crazy idea:
    Perhaps Fastscripts could be modified so that it recognizes .flextime files. Click one in the menu to run it.

  2. Luis de la Rosa Says:

    Awesome – thanks for showing me how to do this. And I learned how startup items work as a bonus. :) Now I know how to get rid of some of the old ones that I don’t need anymore.

Comments are closed.

Follow the Conversation

Stay up-to-date by subscribing to the Comments RSS Feed for this entry.