Thursday, October 30, 2014
  • Index
  •  » Automator
  •  » New to this, need help with "create ad-hoc network" script.

#1 2012-03-09 11:33:22 am

Wilco75
Member
Registered: 2012-03-08
Posts: 12

New to this, need help with "create ad-hoc network" script.

Hey everyone, i'm new to Automator and applescripts and need some quick help.  I found this recently and want to try it with my own music set up...

http://blog.dubspot.com/automator-video-tutorial/

I'm not out of the gate yet and already don't know how to create or where to find a script to create a network between my MBP (running latest Lion) and my iOS devices.  I've searched everywhere and even here on the forums and can't seem to find anything up to date enough to work properly. 

Some help or a point in the right direction would be greatly appreciated.  My intention is to learn about applescripting of course, but right now I want to get into Automator a bit and I can't start my workflow without this script if I want to follow the tutorial.  Thanks in advance.

Model: MacbookPro mid-2010
AppleScript: 2.2.1, editor 2.4.2
Browser: Chrome 17.0.963.78
Operating System: Mac OS X (10.7)

Offline

 

#2 2012-03-23 06:33:43 am

Wilco75
Member
Registered: 2012-03-08
Posts: 12

Re: New to this, need help with "create ad-hoc network" script.

With a great deal of help from ljr_nbg and the tutorials on this forum I was able to piece together some scripts that I found here to solve my problem...

http://forums.presonus.com/posts/list/21262.page
http://hints.macworld.com/article.php?s … 1808383349

So now it turns on Wi-Fi if off, creates an ad-hoc network with 128-bit security and sign in. Hope this can help somebody someday.

For OSX Lion 10.7.3

Applescript:

property NetworkName : "Your Network Name"
property NetworkPassword : "thirteenchara"
property BringupScript : ""
tell application "System Events"
   tell process "SystemUIServer"
       tell menu bar 1
           -- Find Airport Menu
           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 contains "Wi-Fi" then exit repeat
           end repeat
           
           -- Turn on airport and start create network
           tell menu bar item the_menu
               perform action "AXPress"
               -- If Wi-Fi is off, turn it on
               if title of menu item 2 of menu 1 is "Turn Wi-Fi On" then
                   perform action "AXPress" of menu item "Turn Wi-Fi On" of menu 1
                   perform action "AXPress"
               end if
               perform action "AXPress" of menu item "Create Network…" of menu 1
           end tell
       end tell
       
       -- Enter information into Create Network Dialog
       tell window 1
           click pop up button 2
           click menu item 4 of menu 1 of pop up button 2
           set value of text field 3 to NetworkPassword
           set value of text field 2 to NetworkPassword
           set value of text field 1 to NetworkName
           click button "Create"
       end tell
   end tell
end tell

Offline

 
  • Index
  •  » Automator
  •  » New to this, need help with "create ad-hoc network" script.

Board footer

Powered by FluxBB

[ Generated in 0.031 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)