I had to hard google and strain the brain. But I achieved what I wanted!
set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'" if ((mySSID as string) is equal to "ssid1") then mountVolume("AFPVolume", "192.168.200.20", "user1", "pass1", "/Volumes/AFPVolume") else if ((mySSID as string) is equal to "ssid2") then mountVolume("NAS", "192.168.200.30", "user2", "pass2", "/Volumes/NAS") . . . end if on mountVolume(serverPath, serverName, serverUser, serverPassword, localNode) if isMounted(localNode) then return end if set networkProtocol to "afp" if createLocalNode(localNode) then set mountURL to networkProtocol & "://" & serverUser & ":" & serverPassword & "@" & serverName & "/" & serverPath do shell script "mount -t " & networkProtocol & space & quoted form of mountURL & space & quoted form of localNode end if end mountVolume on createLocalNode(localNode) if not fileExists(localNode) then do shell script "mkdir " & quoted form of localNode & "; echo $?" return fileExists(localNode) end if if (do shell script "ls -A " & quoted form of localNode & " | wc -l") as integer is 0 then return true else return false end if end createLocalNode on unMount(localNode) if not isMounted(localNode) then return end if do shell script "diskutil unmount " & quoted form of localNode end unMount on fileExists(posixPath) return not ((do shell script "test -e " & quoted form of posixPath & "; echo $?") as integer) as boolean end fileExists on isMounted(localNode) return (do shell script "mount") contains (" on " & localNode & " (") end isMounted