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 > Need help AppleScripting Internet prefs

Need help AppleScripting Internet prefs
Thread Tools
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status: Offline
Reply With Quote
May 16, 2001, 09:05 AM
 
<< Note: Transferring the original topic "AppleScript help, please!" from Mac OS seems to have killed it (Says "No such file"), so I'm reposting it>>

Hello! I'm trying to write an AppleScript that will allow us to deploy our new Faculty master to the machines this summer. I've got the master itself almost done, but now I'd like to be able have a script that does the following:
1) Prompt for the recipient's username and real name (This part is done).

2) Set the Owner and Machine name based on the input (Also done)

3) Set the internet preferences for these apps, again based on the input to #1:
* Internet control panel (partially done -- weird bug though; see the end)
* Eudora 5
* Netscape Communicator, email module (Messenger, I think it's called)
* Possiby Entourage

I have the Internet control panel partially done, except the OSAX I'm using is geared toward Internet Config and seems to have some bugs with Apple's iteration of IC. Namely, entering "Set ICPreferences mail account <username>" enters the username in both the Mail Account ID blank *and* the mail server blank. This is bad. Can anyone point me to a better OSAX, as well as help me out on the other items on that list? Thanks!

------------------
"Give me ambiguity or give me something else!"
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
     
Junior Member
Join Date: Apr 2001
Status: Offline
Reply With Quote
May 20, 2001, 12:11 AM
 
ok... so i don't know if this falls under the ambiguity or something else category, but here goes...
as near as i can tell, the usual channels don't appear to have any better implementations of osaxen for setting IC preferences, and the dictionaries of Netscape Communicator and Eudora are somewhat lacking in the preferences dept. (entourage may be better, but i don't have a copy... i'm using outlook express 5 which surprisingly has the best support for scripting preferences).
that said, these events could be rigged in a script by scripting keyboard/interface elements with the osax "akua sweets" & "sigma's osax" (both available at http://www.osaxen.com in the Popular folder). the only app that seems like a lost cause, at least with directly setting preferences, is netscape mail. also, unfortunately the apps need to be activated to set preferences in this manner...
here's an example:

Code:
-- oops, this part you've got already; oh well... set user_Name to text returned of (display dialog "Please enter your username..." buttons {"Cancel", "OK"} default button "OK" default answer "") as string set Real_Name to text returned of (display dialog "Please enter your REAL name..." buttons {"Cancel", "OK"} default button "OK" default answer "") as string SetICPreference real name to Real_Name -- and the rigging ensues tell application "Internet" activate delay 2 puppet menu {131, 2} delay 1 type text user_Name quit end tell -- this part's pretty direct from the app's dictionary! -- and Outlook Express 5 & Entourage likely have the same or similar dictionaries -- to use in script, remove the "(*" & "*)" enclosing this block! (*tell application "Outlook Express 5" make new POP account with properties {name:Real_Name, full name:Real_Name, POP ID:user_Name} quit end tell*) -- Just an example for Eudora... especially rigged -- again, to use in script, remove the "(*" & "*)" enclosing this block! (*tell application "Eudora" activate delay 2 puppet menu {507, 7} delay 1 type text tab type text user_Name repeat 2 times type text tab end repeat type text Real_Name click on control "OK" of "Settings" quit end tell*)
again, probably not exactly what you're hoping for, but it seems to do the job... & not sure on this, but i think the entourage dictionary is comparable to that of outlook express 5. i've "commented" this part and the eudora part in the script; to try these out (maybe change oe5 to entourage & remove the "(*" & "*)" surrounding each block.
oh well... hope this helps
cheers, acur

[This message has been edited by acur128 (edited 05-20-2001).]
     
Oneota  (op)
Professional Poster
Join Date: May 2000
Location: Urbandale, IA
Status: Offline
Reply With Quote
May 20, 2001, 09:59 PM
 
Thanks a lot!! I'll be sure to try that @ work on Monday. I actually visited Qualcomm's website and did a search for AppleScript; I found some interesting stuff. It's apparently possible to set Eudora preferences, they just didn't make it easy; you have to do a "set preference x to "blah blah" " where x is some number taken from a table (like Real Name is 77, I think).

Thanks again (especially the Entourage part; I have high hopes for that)!

------------------
"Give me ambiguity or give me something else!"
"Yields a falsehood when preceded by its quotation" yields a falsehood when preceded by its quotation.
     
   
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 11:12 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