auto attach network drive after sleep

Discussion in 'MacBook Pro' started by Alienbrain, Dec 24, 2007.

  1. Alienbrain macrumors member

    Alienbrain

    Joined:
    Sep 11, 2007
    Location:
    New England
    #1
    How do I get my network drive to automatically attach after I close my notebook book, or after it comes out of sleep mode. I do not want to manually attach the drive every-time. I do have the drive attaching automatically on start up.

    I appreciate any help thank you.
     
  2. Dan-- macrumors regular

    Joined:
    Jul 30, 2008
    #2
    Here's how to nearly auto attach

    Thanks to BDAqua on discussions.apple.com for the most important first part of this.

    Once you get the drives on the desktop, just get aliases to them, and then use those aliases to reconnect to the drives as a quick shortcut. And then you can use an Automator script to automate this, so a double-click on a desktop item opens all your needed drives instantly

    Here are the details.

    1. Get the items on your desktop by connecting to the drives.
    2. If you only have one (or few) you can drag it (them) to your dock, adjacent to the trash can.
    3. Or, you can make an automation script that you can stick on your desktop or in the dock...
    4. First, create a folder such as "Shares" in a convenient or an out of the way place. (You will only need to access it when you place new drives in it, and once in creation of the script.)
    5. Drag the mounted drives into the "Shares" folder. OS X will make aliases there.
    6. At this point, you can eject the mounted drives, and "opening" (say, by double-clicking) the drive aliases, and the drives will re-appear.
    7. We can use this to make an Automator script.
    8. Open Automator from its place in the Applications folder, or by getting it from Spotlight.
    9. In the leftmost panel, "Library", select Finder to narrow the options.
    10. In the Action panel, to the right, grab "Get Specified Finder Items" to the righmost panel.
    11. Drag the folder you created earlier called "Shares", into the open area for "Get Specified Finder Items" in the rigtmost panel.
    12. Drag "Get Folder Contents" from the Action panel into the open space below "Get Specified Finder Items" in the rightmost panel.
    13. Drag "Open Finder Items" from the Action panel into the open area under "Get Folder Contents" in the rightmost panel.
    14. You can test it by ejecting the drives (if they are open), and clicking the Run button in Automator.
    15. If the drives show up on the desktop again, you're set.
    16. First save it normally, as a Workflow, so you can edit it later if need be: In Automator, choose File->Save, and name it something like OpenShares Workflow.
    17. Now save it as an application - choose: File->Save As..., and change File Format: from Workflow to Application. You can name it whatever you like. Mine's called OpenPCShares, and I saved this one to my desktop. You can even drag this to the dock (the left side) anywhere you like.
    18. You can be done, but for a nice finishing touch, I liked changing the icon from the Automator Robot to the network icon. You can do this by connecting to a drive and doing Get Info on it, then click the *little* network icon at the top left, and select Edit->Copy. (If you can't copy, you didn't pick the right icon.) Then do a Get Info on the Automator script you created, and click the little Automator icon - again, top left, and then do Edit->Paste. Close everything up, and your done. Just try it out.
    19. Oh, if you want to add drives later, just drag them into the Shares folder you created earlier. The script looks for the contents of the folder.

    This was developed and tested in OS X 10.4.11.
     

Share This Page