Here is a repost of a Faq I made a long time ago. The problem it solved was different, but you'll get the same resolve. Instead of 'sidebar', think 'login item panel'...
Mac OS X is great in how it allows you to skin a cat in a multiple of ways. Something that frustrated me, though, is the Finder's Sidebar window. You can drag almost anything into it, and those items act like aliases. But what about mounted server shares? Nope. It will not let you drag a share into the Sidebar. So we are forced to use the 'Connect to Server' window. With Automator we can get around these annoyances.
Here's how to use Automator to work around this issue. Note that for a truly automated solution, you should first mount the share and store the credentials in Keychain. Once that's done (the share must be mounted, in any event), follow these steps:
- Launch Automator, which will create a new workflow.
- From the Finder Library, drag the Get Specified Servers Action into the workflow. Click the [+] and enter the address of your server. Something like cifs://server/share, then click Connect.
- From the Finder Library, drag the Connect to Servers Action into the workflow. Be sure 'Use Results from Previous Action' is enabled in the URLs pulldown. (The following three steps are optional. They will open a Finder window focused on the mounted share and set the View for it.)
- Add the Finder Action Get Specified Finder Items to the workflow. Click the [+] and select the share you want to automate mounting of. Click Open.
- Drag Finder's Open Finder Items Action into the workflow. 'Open with' should be 'Default Application.'
- To make sure the Finder honors your preferred view, drag Finder's Set Folder Views action into the workflow. Use the options to your liking.
- Select Save As, and set the File Format to Application. I suggest saving it to your user's Applications (~/your_user/Applications) folder, and naming it with the share's name.
- In the Finder, navigate to where you saved this Automator app. Drag the new app into the Finder's Sidebar window.
To test your new solution, unmount the share and then click the new application icon in the Sidebar. If the server was not mounted, it will mount. If it was already mounted, you wil not see any errors, and if you did the optional steps, you will be brought to the folder with the view set.
Notes:
- This is most useful on a network with a shared web server. You can share the directory that all of the website accounts are in. So instead of each website being an item in your sidebar, we can now have that share be the single item. When you mount the share, you see all of the websites.
- Based on the list of server types presented in the Connect to Server Automator action, it should work on basically any server you can connect to.