Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 3, 2012, 06:41 PM   #1
Jeshua
macrumors newbie
 
Join Date: Jan 2012
Applescript application not working within Automator

Hi guys, I'm really new to Applescripting and I wanted to download and tweak some scripts from the web. The following script I downloaded creates an Ad-hoc network with a password for me.

Code:
 
property CreateMenuName : "Create Network…"
property NetworkName : "Network"
property NetworkPassword : "12345"

tell application "System Events"
	tell process "SystemUIServer"
		tell menu bar 1
			set menu_extras to value of attribute "AXDescription" of menu bar items
			repeat with the_menu from 1 to the count of menu_extras
				if item the_menu of menu_extras is "Airport Menu Extra" then exit repeat
			end repeat
			tell menu bar item the_menu
				perform action "AXPress"
				delay 5
				perform action "AXPress" of menu item CreateMenuName of menu 1
			end tell
		end tell
		repeat until exists window 1
			delay 5
		end repeat
		tell window 1
			click checkbox 1
			click pop up button 2
			click menu item 1 of menu 1 of pop up button 2
			set value of text field 2 to NetworkPassword
			set value of text field 3 to NetworkPassword
			set value of text field 1 to NetworkName
			click button 1
		end tell
	end tell
end tell
It works great as a standalone script and as a run only application, but when I use the Launch Application command in Automator I receive an error and the script tries to run in a continuous loop.

Is there anything I should change with the script or is this an automator issue?

I'm running OSX 10.6.8
Jeshua is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting 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

Forum Jump


All times are GMT -5. The time now is 06:44 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC