Scripting system preferences...

I would like to press the button ‘Apply Now’ of ‘Network’ of ‘Internet & Network’ of ‘System Preferences’ if it is active. Is this possible?

That would require Apple’s GUI Scripting.

The basic code would be…

click button "Apply Now"  of window "Network"  of application process "System Preferences"

Mr. Spence,
Thanks, not only for this suggestion, but for all the other ones as well. It’s nice to have a forum where one can tap into the experience of top notch scripters.
Here’s the final code I went with:

Thanks for the kind words David. I used UI Browser, from PreFab, get the needed info. UI Browser is, by far, one of the best tools for GUI scripting. T.J. Mahaffey did a review of UI Browser back in January at our unScipted section. UI Browser has advanced considerably since then – to the point to where it can actually write out AppleScript code for you – nice. The good folks at PreFab still offer a 30 day unrestricted demo which is available at…

The authors are very responsive, helpful, and readily available via email.