+ Post New Thread
Results 1 to 2 of 2
Mac Thread, Mac Applescript in Technical; Hi, I am new to this forum. Would appreciate any help. I am currently trying to execute the following Applescript: ...
  1. #1

    Join Date
    Jul 2013
    Thank Post
    Thanked 0 Times in 0 Posts
    Rep Power

    Mac Applescript

    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"

    mount volume
    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"
    end if

    end tell
    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.



  2. #2
    AntonioRocco's Avatar
    Join Date
    Oct 2008
    South Yorkshire
    Thank Post
    Thanked 114 Times in 95 Posts
    Rep Power

    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)
    Last edited by AntonioRocco; 24th July 2013 at 12:21 AM.

+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 25th November 2008, 04:12 PM
  2. mini macs and midi
    By russdev in forum Mac
    Replies: 7
    Last Post: 29th November 2005, 03:08 PM
  3. for all those who like widgets on mac
    By russdev in forum Educational Software
    Replies: 3
    Last Post: 25th July 2005, 08:19 PM
  4. Mac Software?
    By dagza in forum Mac
    Replies: 9
    Last Post: 22nd July 2005, 10:44 PM
  5. How are your mac's connected ?
    By daveyboy in forum Mac
    Replies: 11
    Last Post: 16th July 2005, 02:52 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts