• 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
Re: Scripting Internet Connection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Internet Connection


  • Subject: Re: Scripting Internet Connection
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 18 Jan 2006 05:44:43 -0500
  • Thread-topic: Scripting Internet Connection

on 2006-01-17 8:58 PM, David C Andrews at email@hidden wrote:

> Is there any way to script the Internet Connection (PPPoE in the Menu
> Bar that shows as <€€€>)? UlElementInspector show the menu name as ""
> so there appears that there is no way to "Connect" or "Disconnect"
> using script on the Menu Bar. Any help would be appreciated. (I do not
> want to have to open a control panel to do this, unless it can be
> hidden -- not come up even briefly.)

If there is no menu title, try 'menu 1'.

Here's an example of how to control menu items in "menu extras" at the right
end of the menu bar. It requires Tiger, because menu extras weren't
scriptable in Panther (or at least not very much).

-- TURN OFF BLUETOOTH POWER
-- Set the bluetoothIndex to suit your setup
-- (for best stability, count from the end)

property bluetoothIndex : -6

activate application "SystemUIServer"
tell application "System Events"
    tell process "SystemUIServer"
        set bluetoothItem to menu bar item bluetoothIndex of menu bar 1
        click bluetoothItem
        tell menu 1 of bluetoothItem
            if title of menu item 1 does not start with "BlueTooth" then
                beep
                display dialog "This is not the BlueTooth menu extra."
buttons {"OK"} default button "OK"
                return
            end if
            if title of menu item 2 ends with "Off" then
                click menu item 2
            end if
        end tell
    end tell
end tell


But the Internet Connect application is scriptable and has  'connect' and
'disconnect' commands.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Scripting Internet Connection (From: David C Andrews <email@hidden>)

  • Prev by Date: Re: NDN: Re: Finder scripting bug
  • Next by Date: Re: Scripting Internet Connection
  • Previous by thread: Scripting Internet Connection
  • Next by thread: Re: Scripting Internet Connection
  • Index(es):
    • Date
    • Thread