Best way to implement startup of App between certain hours using MAC OSX

Discussion in 'Apple' started by shofu_au, Jan 1, 2007.

  1. shofu_au

    shofu_au Guest

    Hi Group,

    My ISP has changed it rules and now does not could downloads between
    midnight and midday in your monthly usage. So I would like to use a
    Bitorrent program between these hours. I am currently using Azureus

    On my Powerbook laptop I have the Energy Saver to boot my laptop at
    midnight and shutdown at midday. In my Account I have set the Login
    Items to automatically start Azureus.

    This all works fine for the middle of the night when I am sleeping.

    However if I turn my laptop on during the day Azureus still starts and
    it can be really slow to stop, due to its long startup process.

    Is there anyway to limit the actually starting of Azureus (and other
    programs) via Mac OSX between the hours of midnight and midday?

    Any suggestions / examples on the best way to acheive this? Cron?


    shofu_au, Jan 1, 2007
    1. Advertisements

  2. shofu_au

    David Empson Guest

    A reasonably simple AppleScript application can be created to
    conditionally launch an application during certain times of day.

    Launch Script Editor and copy and paste the following into the window
    for a new script:

    set theHour to hours of (current date)
    if theHour >= 0 and theHour < 6 then
    tell application "Azureus" to activate
    end if

    If you run this script between midnight and 6 a.m., it will launch
    Azureus. Any other time of the day it will do nothing.

    Click on the "Run" button to test it (adjust the time comparison numbers
    to confirm that it actually launches Azureus).

    Once you are satisfied that it does what you want, use Save As, and
    select the following options:

    File Format: application
    Options: Make sure "Run Only", "Startup Screen" and "Stay Open" are not

    Save it in a convenient location, such as in your applications folder,
    or somewhere in your home folder. Call it something like "Azureus
    Nightly Launch".

    You can now put that application in your login items, so if you start up
    the computer after midnight and before 6 a.m., it will launch Azureus,
    but if you start up at other times of day it won't.

    If you want to amend the script later, you need to open "Azureus Nightly" from inside Script Editor. You can do this by dragging and
    dropping the application on to Script, or using the Open
    command in the File menu after launching Script Editor.
    David Empson, Jan 1, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.