Snow Leopard - Network volume device greyed out when mounted with AppleScript

Discussion in 'macOS' started by huyby, Oct 15, 2009.

  1. huyby macrumors newbie

    Joined:
    Oct 15, 2009
    #1
    Hi all,

    Before I've upgraded from Leopard to Snow Leopard. I used an applescript to mount a network volume on startup:

    Code:
    delay 4
    tell application "Finder"
    	if not (exists POSIX file "/Volumes/Resources") then
    		mount volume "afp://***.***.***.***/Resources" as user name "stijn"
    	end if
    end tell
    
    This script worked fine under Leopard. But since Snow Leopard, the volume is mounted but it's greyed out in Finder. So I cannot access the volume through Finder > Devices > "Resources", and I can't unmount it either.

    [​IMG]

    I know you can also add a network drive in the login items, but that doesn't work at all because at the time the system wants to mount the drive, the network connection is not yet ready (that's why there is a delay in the applescript).

    Any ideas to stop the volume from "greying" out?
     
  2. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    Try adding a line like:

    update volume "afp://***.***.***.***/Resources"

    Have no direct evidence that this works, however, in a file copying script I use, the copied file appears gray (which SL uses to show the copy is in progress) and it stays that way. I added update filename to the script and the filename appears correctly. Could be a bug in SL or AS.

    mt
     
  3. huyby thread starter macrumors newbie

    Joined:
    Oct 15, 2009
    #3
    Hi, thx for the replies!

    I've tried the 'update' volume, but it seems AppleScript doesn't have something like 'update volume'.

    So I tried the AutomountMaker and (most of the time) the script I've generated seems to mount the volume with success. In the first few launches of the script, the volume was 2 times greyed out, in all other (about 5) test the volume was 'active' in the Finder window.

    I didn 't yet test the script when used as a login item. I'll leave a post when the script is tested for a few days.
     
  4. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #4
    update might require an alias, so you might have to do:

    Code:
    update (volume afp:// ... etc/) as alias
    
    mt
     

Share This Page