Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Anoter newbie question

Anoter newbie question
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2000
Status: Offline
Reply With Quote
Oct 11, 2000, 04:24 PM
 
Ok, I've been oogling the new MacAlley iKeys that have those dub internet buttons on them. I realized what I would like to be able to do is write an applescript that allows me to use an Fkey to toggle my PPP connection on and off. I would imagine that such a script is easy and easily implemented in the keyboard control panel. Here's how I imagine it would work:
It would check to see if the connection is active, and if not, send a TCP command to initiate the connection. if it is active, it would just tell tell computer to shut down the connection. Easier said then done though. and would this work best as an applet, or a script?

Thanks in advance!

---Alex Johnson
     
Blobby
Guest
Status:
Reply With Quote
Oct 11, 2000, 07:02 PM
 
here's a simple one with a modal window
Code:
try if ((state of (RA status)) is "connected") then RA disconnect else RA connect end tell end if on error errMsg number errNum -- Handle errors end try
and a non modal one which requires the Network Setup Scripting extension included with 8.5 and later
Code:
try tell application "Network Setup Scripting" if ((activity of (RA status)) is "idle") then open database begin transaction connect Remote Access configuration "your config name" end transaction close database else open database begin transaction disconnect Remote Access configuration "your config name" end transaction close database end if end tell on error errMsg number errNum end try
would this work best as an applet, or a script? dunno, I don't have OS 9 or iKeys but use Cliff's FKeyRunappmaker to run contextual applets.

     
Fresh-Faced Recruit
Join Date: Oct 2000
Status: Offline
Reply With Quote
Oct 12, 2000, 12:26 AM
 
Blobby,
Thaks for the reply, but I tried the second script, and it doesn't seem to work. I replaced the name in the script with my RA account name, and tried compliling it as a script, an applet for classic, and an applet for OS X. but it didn't seem to work. What am I doing wrong?

Thanks again!
---Alex
     
Blobby
Guest
Status:
Reply With Quote
Oct 12, 2000, 01:16 AM
 
hey Alex, you need Network Setup Extension in the extensions folder and Network Setup Scripting in the Scripting Additions folder. You should be prompted to locate Network Setup Scripting when you compile the script.
Don't save as OS X as it's 'broken'.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:02 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2