Re: Applescript, Leopard, and dialup modems
Re: Applescript, Leopard, and dialup modems
- Subject: Re: Applescript, Leopard, and dialup modems
- From: Brian Christmas <email@hidden>
- Date: Wed, 20 Aug 2008 14:03:33 +1000
On 19/08/2008, at 5:27 PM, Brian Christmas wrote:
On 19/08/2008, at 4:06 PM, Donald Hall wrote:
I am trying to update an old mail checking script from Tiger to
work in Leopard. The original used "Internet Connect" to determine
the state of the dialup connection so that it could be made to be
the same after the script ran as before - i.e. if you were not
connected to the Internet before the script checked the mail, you
were immediately disconnected after the check.
"Internet Connect" is not part of Leopard. Can anyone suggest a way
(involving Applescript) of determining the state of a dialup
connection in Leopard?
Thanks,
Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
G'day Don
After my post yesterday, I posted on macscripters, and received an
answer courtesy of StefanK.
Network Preferences is now directly scriptable via System Events in
Leopard.
If I can be of further help, let me know.
Regards
Santa
An example.....
tell application "System Events"
tell network preferences
tell current location
set aPPPoEService to a reference to (first service whose kind is 10)
if exists aPPPoEService then
connect aPPPoEService
end if
end tell
end tell
end tell
The Suite is .....
connect v : connect a configuration or service
connect any : a configuration or service
→ configuration
disconnect v : disconnect a configuration or service
disconnect any : a configuration or service
→ configuration
configuration n [inh. item] : A collection of settings for configuring
a connection
elements
contained by services.
properties
account name (text) : the name used to authenticate
connected (boolean, r/o) : Is the configuration connected?
id (text, r/o) : the unique identifier for the configuration
name (text) : the name of the configuration
interface n [inh. item] : A collection of settings for a network
interface
elements
contained by network preferences objects.
properties
automatic (boolean) : configure the interface speed, duplex, and mtu
automatically?
duplex (text) : the duplex setting half | full | full with flow control
id (text, r/o) : the unique identifier for the interface
kind (text, r/o) : the type of interface
MAC address (text, r/o) : the MAC address for the interface
mtu (integer) : the packet size
name (text, r/o) : the name of the interface
speed (integer) : ethernet speed 10 | 100 | 1000
location n [inh. item] : A set of services
elements
contains services; contained by network preferences objects.
properties
id (text, r/o) : the unique identifier for the location
name (text) : the name of the location
network preferences object n [inh. item] : the preferences for the
current user's network
elements
contains interfaces, locations, services.
properties
current location (location) : the current location
service n [inh. item] : A collection of settings for a network service
elements
contains configurations; contained by locations, network preferences
objects.
properties
active (boolean, r/o) : Is the service active?
current configuration (configuration) : the currently selected
configuration
id (text, r/o) : the unique identifier for the service
interface (interface, r/o) : the interface the service is built on
kind (integer, r/o) : the type of service
name (text) : the name of the service _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden