Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Sep 1, 2012, 04:32 AM   #1
anton1s
macrumors member
 
Join Date: Jun 2012
HOW TO: map drives if on correct SSID

Hi All

What i am trying to achieve is to map external drives from my NAS only when my MBA is connected on a specific SSID

I found few scripts that check the SSID and I have the relevant applescript. There is a variable you can use with automator but this is only to display the IP and not the current SSID.

The way I have it so far is (Automator application is called MapDrives):

automator:
1) pause 7 seconds
2)Get value of variable (IP)
3)Run Applescript below (the script needs tweaking)

Code:
on run {input, parameters}
	set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"
	if (tIP as text) is not equal to "<ip address of my MBA>" then
		tell application "MapDrives" to quit
	end if
end run
4) Get Specified servers
5)Connect to servers


What I also need to check if the drives are already mapped then not to proceed with the script?

Last edited by anton1s; Sep 1, 2012 at 07:29 AM. Reason: update automator script
anton1s is offline   0 Reply With Quote

 
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
Unknown Network SSID showing theslaz Mac Peripherals 6 Dec 22, 2013 09:17 AM
New Map App BLANK in Map View MagnusVonMagnum OS X Mavericks (10.9) 6 Nov 8, 2013 04:43 PM
naming external drives, hard drives, thum drives for best compatability Sossity Mac Peripherals 1 Apr 5, 2013 04:11 AM
Google Map or Apple Map? Henry Li iOS 6 129 Sep 23, 2012 10:29 AM
Map Speedo, A cool map + speedometer askpi iPhone and iPod touch Apps 0 Jun 15, 2012 08:33 PM

Forum Jump

All times are GMT -5. The time now is 05:04 PM.

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

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