I am new to this forum. Would appreciate any help. I am currently trying to execute the following Applescript:
set strPrefs to "smb://ncc-sharedspace/Prefs"
set strUserName to do shell script "whoami"
tell application "Finder" if not (exists folder "& strUserName &" of disk "strPrefs") then
do shell script "mkdir /Volumes/Prefs/" & strUserName & ""
do shell script "echo hello"
Everytime it keeps saying the files exists which is fine so it should execute the else part of the if statement but it just wont!!!!! Arrgggghhhhh
Any pointers/help would be most welcome.
Not knowing exactly what it is you're trying to do but guessing from the little you've provided a couple of things appear to be not quite right to my untrained eye.
For example /Volumes/Prefs seems to indicate a local hard drive named Prefs? For me that would be an odd name to call the hard drive? Usually you would leave the hard drive at its default (Macintosh HD) or use some other consistent and logical name. Or perhaps what you really want is the shared directory called Prefs that exists on a Windows Server called ncc-sharedspace to mount on a mac's desktop once the correct authentication details are given? In that case you would use the full path to that directory instead: /Network/Volumes/ncc-sharedspace.whatever/Prefs.
Another aspect of the script which may cause it to fail is (as ever) DNS. Although your location might be fine unfortunately some schools idea of DNS and what it is and how to use it falls far short of what it should be. Whatever is the case it's a good idea to double-check it just in case. Are you sure that the mac(s) in question can resolve ncc-sharedspace to a logical IP address? In other words is your DHCP service handing out the correct search domain suffix to allow proper forward and reverse name/IP address resolution? Launching Terminal on any mac and issuing 'ping ncc-sharedspace' should return the correct IP address for that server. If it does not then have a look at your DHCP service and make sure it's giving out the correct domain information to your nodes.
If I've guessed correctly regarding the reason for your script then I have to ask why? If all you want to do is mount a windows based share on a mac using an active directory account's credentials, you can do so by simply applying a managed preference policy using either MCX (via WorkGroup Manager) or xml plist using Profile Manager.
Antonio Rocco (ACSA)