-- The vast majority of this script has been hobbled togeather by Graham Heath Loadedsith -at- gmail.com on Feb 11 2006 -- -- All of the actual content was found on macosxhints.com but has been modified to provide new functions -- the ip address detection was taken from a script Created by Daniel Veiner on Tue Oct 19 2004. http://www.macosxhints.com/dlfiles/mount_sparseimages_scpt.txt -- I learned about the property command from http://www.macosxhints.com/dlfiles/mount_sparseimages_scpt.txt so thanks to whom ever wrote that. --please dont make money off this, i didnt --please send me an email greeting card if you really like this -- define these vars as you need, you can change how many you need by changing the number of times mountThis is run --set these property homeIp : "66.67.175.46" property homeMount1 : "smb://newt/Sea" property homeMountPath1 : "/Volumes/Sea" property homeMount2 : "smb://newt/Dee" property homeMountPath2 : "/Volumes/Dee" property homeMount3 : "smb://newt/Eee" property homeMountPath3 : "/Volumes/Eee" --set these too property workIp : "22.22.22.22" property workMount1 : "smb://workbox/workShare" property workMountPath1 : "/Volumes/workShare" -- alter this to work with your above changes.on doMounting() set ip_address to extract_ip() if ip_address is homeIp then mountThis(homeMount1, homeMountPath1, spotlightOrNot) --delay (0.5) mountThis(homeMount2, homeMountPath2, spotlightOrNot) --delay (0.5) mountThis(homeMount3, homeMountPath3, spotlightOrNot) --delay (0.5) end if if ip_address is workIp then mountThis(workMount1, workMountPath1, spotlightOrNot) end if end doMounting --ignore this, im just instanciating it property spotlightOrNot : false set ip_address to extract_ip() -- start modified from Daniel Veinerset the Reply to display dialog "You have been detected as being at: " & ip_address & ¬ " if there are drives related to this ip what would you like to do? If not, just press 'Meh' or wait 10 seconds" buttons {"Spotlight my mounts", "Just mount them", "Meh"} ¬ default button "Just mount them" giving up after 10 with icon note -- end modified from Daniel Veiner if button returned of Reply is "Just mount them" then set spotlightOrNot to false doMounting() end if if button returned of Reply is "Spotlight my mounts" then set spotlightOrNot to true doMounting() end if on mountThis(mountLocation, mountPath, spotlightOrNot) tell application "Finder" activate end tell mount volume mountLocation delay (0.5) if spotlightOrNot is true then do shell script "mdutil -i on " & mountPath with administrator privileges end if end mountThis --start Created by Daniel Veiner on extract_ip() set response to do shell script "/usr/bin/curl http://checkip.dyndns.org/" set clean_ip to "" set this_char to "" repeat with this_char in response set this_char to the contents of this_char if the this_char is in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."} then set the clean_ip to the clean_ip & this_char as string end if end repeat return the clean_ip end extract_ip -- end created by Daniel Veiner