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

Similar Threads
thread Thread Starter Forum Replies Last Post
Using Automator to play audio file from within Automator made application? nobodyhome OS X 10.8 Mountain Lion 0 Jan 14, 2014 03:23 PM
AppleScript inside Automator not working alexk403 Mac Programming 1 Jul 21, 2013 10:09 PM
Automator and/or AppleScript Help jbsmithmac Mac Programming 6 May 5, 2013 04:02 PM
Automator and/or Applescript Help downingp Mac Programming 2 Oct 24, 2012 07:35 PM
Applescript and Automator Mix anton1s Mac Programming 0 Oct 20, 2012 07:02 PM

Forum Jump

All times are GMT -5. The time now is 01:19 AM.

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

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