Benches macOS

2

script for internet connect with dial up …

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I am looking for a script to connect to the internet (with dial up) external apple modem, then check email and then log off and disconnect. I don't want any other applications opening internet connect? A would use this script file with ical and could have my email checked and open up in the morning before I leave for work....being that we have dial up the entire process of connecting to the internet and checking email is time consuming. Any help is greatly appreciated. thks

2 replies

Sign in or join Beachball Help to reply.

  1. 0

    dev_sleidy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Here is some starter code:

    property tUser : "user_name" -- User Name.

    property tPassword : "user_password" -- User Password.

    property pNumber : "18005551212" -- ISP Phone Number.

    -- Make an internet connection.

    tell application "Internet Connect" to connect (PPP configuration 1) to telephone number pNumber as user tUser with password tPassword

    tell application "Mail" to activate -- Activate assumed e-Mail'er application.

    -- tell application "Internet Connect" to disconnect (PPP configuration 1) -- Optional. Disconnect from telelphone line.

  2. 0

    Camelot

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You need some additional logic in there - as written, the script will launch mail, then immediately disconnect the internet connection.

    At the very least you need to add a delay before disconnecting to allow for Mail to download awaiting messages.

    Since you cannot predict how long a delay you'll need, a better approach would be to query Mail.app and wait until it's idle, like:

    tell application "Mail"

    launch -- doesn't need to be frontmost

    check for new mail -- get all mail

    repeat until (get background activity count) = 0

    delay 2 -- wait 2 seconds before checking again

    end repeat

    end tell

    In this way the script forces a check of new mail (don't assume that Mail.app is set to auto-check, especially for dialup users who often compose mail offline and may have automatic checking disabled), and it hangs around until Mail.app has finished downloading all the messages.