simple script - Internet Connect, Create Network

Hi, I’m a newbie. I’ve spent some time searching posts for help on this with no luck. I need a simple script for an auto-start in the machine that runs my art project (http://www.octamasher.com.

I want to activate Internet Connect,
from the “Network” drop down, select “Create Network”
Press “OK” to accept the default settings

Any tips would be greatly appreciated.

Cheers,
Moldover
www.moldover.com

Model: intel mac mini
AppleScript: 2.1.1
Browser: Firefox 2.0.0.4
Operating System: Mac OS X (10.3.9)

Hi Moldover.

welcome to MacScripter

Try this:


activate application "Internet Connect"
tell application "System Events"
	tell window 1 of process "Internet Connect"
		tell pop up button 1
			click
			click menu item "Create Network." of menu 1
		end tell
		repeat until exists sheet 1
			delay 0.5
		end repeat
		tell sheet 1 to click button "OK"
	end tell
end tell

Hey Stefan,

Thanks for your help with this. I tried this script and several variations on it. I keep getting the AppleScript error:

System Events got an error: NSReceiverEvaluationScriptError: 4

Do you know what could be wrong? If I could get these System Events UI commands to work, I could do a lot with scripting really easily. I haven’t found a good reference or example code for these kinds of commands. Can you direct me to one?

Thanks!
Moldover

Is “Enable access for assistive devices” activated in System Preferences > Universal access? (It must be)

That’s it. Thanks so much! You rock!!!

I don’t want to trouble you further, but do you know where I can find an index of names for UI objects? Things like the items in your script: “button” and “menu item”. This would help me get started on future scripts.

Thanks again,
Moldover