check email at startup

I am brand new to this board and very new to AppleScript. I have been working, with help from another group, on a script to be place in my startup folder to check email each morning when the computer starts up. At the end it should disconnect from the dial-up connection.

Here is the script we have devised. Can you offer suggestions and/or improvements?

Thanks for your assistance,

Ross Huter

set t to (current date)'s time
if t > 24900 and t < 25500 then – 6:55 to 7:05am
with timeout of 1000000 seconds
tell application “Eudora” to connect with checking
end timeout
tell application “Network Setup Scripting”
try – (just a precaution in case the db should still be open)
close database
end try
open database
set c to Remote Access configurations whose active = true
disconnect c’s item 1
close database
end tell
end if

Does it work?

Yes, but I get an error on the disconnect.

“Network setup scripting got an error: Some parameter is missing for disconnect”

Ross Hunter

What happens if you use this?

disconnect c

I’ll make that change and let you know what happens.

Ross

It returns the same error.

Ross

I’m sorry that I can’t test any of this but I don’t have the necessary elements. It might need a full reference to the Remote Access configuration, such as:

disconnect Remote Access configuration c

Or some variant of it. Or maybe even:

 disconnect Remote Access configurations whose active is true

Rob,

I watched the PPP connection this morning as the script ran. Although I still get the error, the phone was disconnected.

The error hightlight was on the line:
disconnect c’s item 1

Ross Hunter

Here’s the original script again:

set t to (current date)'s time
if t > 24900 and t < 25500 then
with timeout of 1000000 seconds
tell application “Eudora” to connect with checking
end timeout
tell application “Network Setup Scripting”
try – (just a precaution in case the db should still be open)
close database
end try
open database
set c to Remote Access configurations whose active = true
disconnect c’s item 1
close database
end tell
end if

In this part of the script:

set c to Remote Access configurations whose active = true 
 disconnect c's item 1

What is item 1 of c ? Is it just the active RA config?

Rob,

I wish I knew the answer to your question. This part of the code was given to by someone who was trying to help disconnect the PPP connection. I’ve written him, but no answer so far.

Thanks for your interest.

Ross Hunter