• 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
Network Setup Scripting Troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Network Setup Scripting Troubles


  • Subject: Network Setup Scripting Troubles
  • From: John Loch <email@hidden>
  • Date: Thu, 25 Jan 2001 12:25:40 -0800

I recently upgraded to Mac OS 9.1 and my simple Internet connection script (using PPP connect) no longer works. So I pulled the following script from the Applescript Guidebook (available from www.apple.com/applescript):

set the config_name to "My Company Remote Connection (Toll free)"
set the wait_amount to 180 -- length of time (in seconds) to monitor connection
set the delay_time to 10 -- length of time (in seconds) between status checks
set the num_queries to (the wait_amount div the delay_time)
set the transaction_ID to ""
try
tell application "Network Setup Scripting"
open database
set the transaction_ID to begin transaction
-- check for and activate the configuration
if (exists Remote Access configuration the config_name) then
set active of Remote Access configuration the config_name to true
else
error "This configuration does not exist: " & config_name
end if
end transaction
-- start the connection process
connect Remote Access configuration config_name
-- check the status
repeat num_queries times
set current_status to the status of Remote Access configuration config_name
set the msg to the message of the current_status
say msg
if the activity of current_status is in {connected, idle} then
exit repeat
else
delay delay_time
end if
end repeat
close database
end tell
on error error_message
try
tell application "Network Setup Scripting"
if the transaction_ID is not "" then abort transaction
close database
end tell
on error
end try
tell application (path to frontmost application as text)
display dialog error_message buttons {"OK"} default button 1
end tell
end try

The problem I am having with this script is that it never returns the status of the connection for the line:

set current_status to the status of Remote Access configuration config_name

I have been unsuccessful in attempting to access the status of a Remote Access configuration. Has anyone figured this out?

- John Loch
email@hidden


  • Follow-Ups:
    • Re: Network Setup Scripting Troubles
      • From: Tod Hallberg <email@hidden>
    • Re: Network Setup Scripting Troubles
      • From: Mr Tea <email@hidden>
  • Prev by Date: Loop through portal using applescript
  • Next by Date: Re: Menu Events [was: Xpress 4.1 and group box type]
  • Previous by thread: Re: Loop through portal using applescript
  • Next by thread: Re: Network Setup Scripting Troubles
  • Index(es):
    • Date
    • Thread