Create a fully functional Volumes folder in 10.3's dock
Oct 01, '04 09:49:00AM
Contributed by: platon
In the old days of Mac OS X, it was possible to put an alias of your Volumes folder in the dock. You can still do that in Panther, but the aliases of the Volumes are no longer navigable, and it won't update when you add and remove CDs and drives. I know there are a lot of discussions about that, but none of the solutions (including shareware) are suitable for my needs. I have a lean system; not even the Finder is running as I use the Terminal instead. Via folders in the dock, I have quick access to all of my files, except to CDs, DMGs, Volumes, etc.
Finally I found a solution to have a folder in the dock which is both dynamically updated after mounting or ejecting a volume, and it's navigable. The solution is to use Folder Action Scripts. Read the rest for the how-to.
[robg adds: The screenshot at left (click it for the large version) is from my machine and demonstrates (a) how this works if you haven't seen it before, and (b) that this hint does work. Note that you can do something similar by just making aliases of your drives and tossing them in a folder. However, this more complex solution will dynamically update the folder's contents as you add and remove CD-ROMs and other volumes.]
- Create a Folder (mine is called "Drives") in a convenient place. Do not use spaces or special characters in the path to the folder, or you must know how to handle these in Unix paths.
- Paste an icon on it if you wish to make it visually distinct in the dock.
- Put the folder in the dock.
- Copy this AppleScript, paste it in a new Script Editor document, and edit it as noted (you must insert the correct Path twice).
- Save the script as a Script (not as an Application) in /Library -> Scripts -> Folder Action Scripts. Call it "Add List Drives."
- Duplicate the script and rename the copy to "Remove List Drives."
- Open the script called "Remove List Drives" in Script Editor and change the first and last line as follows. On the first line, change:
on adding folder items to this_folder after receiving added_items
to:
on removing folder items from this_folder after losing these_items
Then replace the last line, which reads:
end adding folder items to
with:
end removing folder items from
- Save the modified script.
- Open Folder Actions Setup (in /Applications -> AppleScript) and enable Folder Actions in the checkbox.
- In the lower left corner hit the "+" Button to add a folder. You will not see the Volumes Folder, because it is invisible.
- Hit Shift-Command-G, type "/Volumes" and hit Open.
- You will automatically be asked to add a Script to "Volumes." If not, hit "+" under the right column. Add both the "Adding" and "Removing" scripts.
- Be sure to enable the folder and scripts by checking the checkbox.
- As a final step, you need to run the "Add" script once manually to populate the Drives folder. Open the Add script in Script Editor, delete the first and last lines (the on adding... and end removing... lines), then click Run. This will populate the Drives folder.
I don't know if you have to enable "Access for Assistive Devices" in Universal Access in the System Preferences (but mine is checked). Remember that your scripts are stored in the top-level Library, and after a system upgrade, they may be deleted. Back them up! I also made a copy of one of these scripts, deleted the first and last lines as above, and saved them as an Application in a convenient place, so that I can run the scripts whenever I want.
Comments (18)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040923125635336