 |
 |
Applescripting Internet Connect is broken!
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status:
Offline
|
|
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
|
|
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"
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|