Re: open transport scripting
Re: open transport scripting
- Subject: Re: open transport scripting
- From: Tod Hallberg <email@hidden>
- Date: Thu, 18 Jan 2001 08:43:56 -0500
- Organization: Monical Pizza Corporation
First, What operating system and setup are you using?
There are a few ways to do it, but I have not yet tested my ways under OS9.0
or 9.1 to see if they still work.
but here is how I do it.... (I am taking this from something I use every
day, but I have not tested the changes as I have posted here.)
I only need to change the appleTalk and Remote access settings, if you need to
change the modem and TCP/IP configurations, just follow the same basic layout.
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
tell application "Network Setup Scripting"
try
open database
on error
end try
try
begin transaction
on error
end try
--Configuration names I use are {Dial-up, Remote Only , and Ethernet}
if appletalk configuration "Dial-up" exists then
if active of appletalk configuration "Dial-up" * true then
set active of appletalk configuration "Dial-up" to true
end if
else
make new appletalk configuration "Dial-up" with properties ,
{active:true, connecting via:"your config"}
--The connecting via is only if your appletalk actually needs to change
end if
try
end transction
on error
end try
try
begin transaction
on error
end try
if Remote Access Configuration "myInternetSettings" exists then
if active of Remote Access Configuration "myInternetSettings" * true then
set active of Remote Access Configuration "myInternetSettings" to true
end if
else
make new Remote Access Configuration "myInternetSettings" with properties ,
{protocol:ppp, active:true, user name:"Your User name", ,
Phone number:"1-800-Your-Number", ,
password: "Your Password", ,
Saves password: True}
end if
try
end transaction
on error
end try
try
close database
on error
end try
end tell
----THIS NEXT PART USES REMOTE ACCESS COMMANDS OSAX
try
RA connect
on error
tell me to activate
display dialog "Sorry, the connetion cannot be made. Please try again
later." ,
buttons {"OK", "Cancel"} default button {"Cancel"}
end try
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Nick Rule wrote:
>
I'm new to this. I've been trying to run a script that activates an
>
internet configuration set (TCP/IP, Modem, Remote Access settings) and
>
connects via Remote Access without dialogs and buttons. There is a script
>
in Network Scripting in the Scripting Guidebook that does this but I try to
>
take out the dialog options and the script doesn't run. Is it possible?
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users