Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Is it possible to add an icon to the dock that will...

Is it possible to add an icon to the dock that will...
Thread Tools
Dark Sailor
Fresh-Faced Recruit
Join Date: Aug 2005
Location: NJ
Status: Offline
Reply With Quote
Apr 30, 2006, 09:35 AM
 
...eject an external hard drive when clicked on?

Also, I have seen icon sets with icons that look like a power button, which appear to be intended for the dock. How does one make an icon bring up the "Are you sure you want to shut down your computer now?" window upon clicking?

Thanks in advance for any tips. Much love for the Forum.
     
naphtali
Dedicated MacNNer
Join Date: Mar 2003
Status: Offline
Reply With Quote
Apr 30, 2006, 10:48 AM
 
I suppose you could do that in AppleScript by writing something like

Tell application "Finder"
eject "DiskName"
End tell
then compile it as an applet and put it on the dock with a custom icon that corresponds to the hard drive.

I've tried this once with my external drive and it seems to work fine.

I notice that you can do the same for "shut down", though the Finder AppleScript dictionary says it is a legacy command now delegated to other applications (I found it under System Events too). Tried it and the script doesn't bring up a confirmation dialogue before shutting down.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:49 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,