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 > Applescripting Internet Connect is broken!

Applescripting Internet Connect is broken!
Thread Tools
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status: Offline
Reply With Quote
Sep 8, 2002, 10:20 AM
 
I'm hoping that one of you AppleScript heavyweights will read this (Synotic?!?)...

I have written the following script for Internet Connect version 1.1 (in Mac OS X 10.1.5):

Code:
tell application "Internet Connect" set the user_name to the user name display dialog user_name end tell
As far as I can tell, this should display the user name for my ISP account, but it instead results in an "NSReceiverEvaluationScriptError: 3".

Any help, comments or information on whether or not this has been fixed in Jaguar would be most appreciated!

Cheers,
Richard
PM G4 DP 500 MHz, 768 Mb, DVD-ROM, 85 Gb, Mac OS X 10.3.9
PB G4 1.25 GHz, 512 Mb, DVD-R, 80 Gb, Mac OS X 10.4
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Sep 8, 2002, 03:23 PM
 
My first thought is what user name?

Internet Connect lets you define multiple connections, so how does it know which connection you're asking about. I think you need to be more specific.

The following code works for me (10.2):

Code:
tell application "Internet Connect" set theConfig to PPP configuration 1 set user_name to user name of theConfig display dialog user_name end tell
Or if you're already online, you should be able to use 'current configuration' instead of 'PPP configuration 1"
     
Richyfp  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status: Offline
Reply With Quote
Sep 8, 2002, 03:36 PM
 
Thank you sooooo much - I'm not very experienced with Applescript, but I tried so many different combinations that I thought it had to be broken!! I kept on getting results like "RAts" in the dialog box!!

Thanks once again,
Richard
PM G4 DP 500 MHz, 768 Mb, DVD-ROM, 85 Gb, Mac OS X 10.3.9
PB G4 1.25 GHz, 512 Mb, DVD-R, 80 Gb, Mac OS X 10.4
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Sep 9, 2002, 02:57 AM
 
If you're serious about AppleScripting, you should consider getting a copy of Late Night Software's Script Debugger.

One of its coolest features is the Application Explorer. Select an application and Script Debugger will tell you all the properties of the application, including their current values. Once you find the variable or object you want, click on it and Script Debugger will tell you the exact syntax that references the object.

Even cooler is the ability to drag an object from the Explorer to your script. Script Debugger will drop the reference to the object to your script.

The following image shows the Explorer looking at Internet Connect:



You can see I've highlighted in red the reference to the selected object "user name of PPP Configuration 1" which is actually one step less than my original script.

It's a very cool program for serious AppleScripting.

Note: I'm not affiliated in any way with Late Night Software, other than as a long-time satisfied customer.
     
   
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 01:45 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