• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Switching PPP & TCP/IP configurations with AS.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching PPP & TCP/IP configurations with AS.


  • Subject: Re: Switching PPP & TCP/IP configurations with AS.
  • From: Mr Tea <email@hidden>
  • Date: Tue, 23 Jan 2001 13:53:58 +0000

This from jitse - dateline 1/23/01 12.39 pm:

> is it possible the make a script that decides which ISP to use at the
> current time and changes the settings accordingly?
> thanks a lot.jitse

YES! AppleScript can do this.

First write the current time into a variable...

set theTime to (current time)

... then establish the times you want one or the other ISP to get connected
to.

Lets say you want to connect to ISP 1 between 9am and 5pm, and ISP 2 at all
other times, and you have both configurations stored as Location manager
settings...

tell application 'Location Manager'
if theTime comes after 9*hours and theTime comes before 17*hours then
set current location to location "ISP 1"
else
set current location to location "ISP 2"
end if
end tell

... and then you can get on with connecting etc.

I've written the above script using 'English-like' syntax for clarity, but
the whole thing can be shrunken down and obfuscated as you see fit.

NB - 'current time' is measured as the number of seconds elapsed since
midnight. Applescript automatically assigns an appropriate value when it
encounters the terms like 'minutes' (60 seconds), 'hours' (3600 seconds),
and even 'days' (86400 seconds)

You could also configure the script to do different things on different days
(eg if it's the weekend) by getting the 'weekday' of the 'current date'

Incidentally... having to toggle between ISPs at various times of the day to
get the cheapest rates sounds like a real bore. What a shame you don't live
here in Cardiff, where NTL offers totally tariff-free surfing 24/7 with a
regular modem, and provides a Cable modem service for a laughable 15 quid a
month (about $22). Makes British Telecom's rates look positively usurious.

Cheers

Mr Tea
--
Brew of the day: China Yunnan


  • Follow-Ups:
    • Re: Switching PPP & TCP/IP configurations with AS.
      • From: jitse <email@hidden>
References: 
 >Re: Switching PPP & TCP/IP configurations with AS. (From: jitse <email@hidden>)

  • Prev by Date: Re: desktop
  • Next by Date: Shirley Hopkins "AppleScripting QuarkXPress" ... is there a website?
  • Previous by thread: Re: Switching PPP & TCP/IP configurations with AS.
  • Next by thread: Re: Switching PPP & TCP/IP configurations with AS.
  • Index(es):
    • Date
    • Thread