Applescript ProXPN Login

Discussion in 'Mac Programming' started by arcobb, Nov 5, 2014.

  1. arcobb macrumors regular

    Joined:
    Feb 3, 2005
    Location:
    Colorado
    #1
    I am trying to write an applescript to automatically login to ProXPN on login. My script is close. Here is what I have:

    Code:
    launch application "proXPN"
    delay 5
    tell application "System Events" to tell process "proXPN"
        tell menu bar item 1 of menu bar 2
            click
        end tell
    end tell
    I would like to select the "Dallas 2, USA" server in the drop down list. Thank you for any help!
     
  2. arcobb thread starter macrumors regular

    Joined:
    Feb 3, 2005
    Location:
    Colorado
    #3
    Thanks! I got an Automator script to do what I what, although not as elegant as it could be. The links looks like a lot of learning for me, I rarely use apple script to spend a ton of time on them.

    The script provided starts to work, it tries to open a menu item and then stops. I was hoping someone who knew applescript better then I could point out the error. The action I was looking for is ProXPN icon (on menu bar) -> connect -> Dallas 2, USA.

    Thanks!
     
  3. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #4
    Try this :

    Code:
    tell application "System Events"
    	tell process "proXPN"
    		tell menu bar item 1 of menu bar 2
    			click
    			if exists menu 1 then
    				set menuItemConnect to click menu item "Connect" of menu 1
    				if exists menu 1 of menuItemConnect then
    					click menu item "Dallas 2, USA" of menu 1 of menuItemConnect
    				end if
    			end if
    		end tell
    	end tell
    end tell
    
     
  4. arcobb thread starter macrumors regular

    Joined:
    Feb 3, 2005
    Location:
    Colorado
    #5

    Thanks kryten2. It works!
     

Share This Page