Help with an Applescript

Discussion in 'Mac Apps and Mac App Store' started by Theydonboi, Nov 5, 2012.

  1. macrumors member

    Joined:
    Jun 22, 2011
    #1
    Hey all,

    I have an apple script that runs on my MacBook that, on login, automatically mounts a connection to the iTunes share on my Synology NAS :

    mount volume "smb://diskstation/Music/"

    This works great...except when I'm not at home and the MacBook can't reach the NAS. This means that the applescript just hangs on my dock at error. This occasionally cause issues on shutdown as there's still, technically, an application running.

    I tried entering a timeout:

    with timeout of 60 seconds
    mount volume "smb://diskstation/Music/"
    end timeout
    quit

    Unfortunately, this changes nothing. The applescript gets stuck as it shows an error which must be cleared manually:

    "an error of type -36 has occurred
    Edit / OK"

    Is there a way to bypass this error message and simply quit the script if it can't run?

    Any ideas?
     
  2. macrumors newbie

    Joined:
    Oct 13, 2012
    #2
    This might work.

    Code:
    try
    	mount volume "smb://diskstation/Music/"
    on error
    	error number -128
    end try
     
  3. macrumors P6

    Weaselboy

    Joined:
    Jan 23, 2005
    #3
    You might try the free app Control Plane. You can set it to recognize your home network login and auto mount the NAS only then. Nice app.
     

Share This Page