Go Back   MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 11, 2008, 11:22 AM   #1
pyles
macrumors newbie
 
Join Date: Jan 2008
Automator - Script for Ejecting all USB Devices

Hey guys,

I have a belkin USB Hub that I use to plug in my External HDD's, iPod, printers, USB thumbdrive, etc.

I was wondering (as I am just beginning, made my first Automator script last night), if I could use Automator to eject all of these things for me, so that when I want to take my Macbook I can just run that script and everything ejects.

I have it setup so that it will eject my 3 External HDD's, but when I have my iPod plugged in and I Use the default iPod Eject built into automator it says no iPod is connected (but one is because I see it in iTunes, etc).

So I am wondering, how do I actually get my iPod to eject, and is there a way to get it so that any external HDD's/Printers/Thumb drives I plug in, will automatically eject?

Thanks!
pyles is offline   0 Reply With Quote
Old Apr 11, 2008, 11:37 AM   #2
xUKHCx
Administrator emeritus
 
xUKHCx's Avatar
 
Join Date: Jan 2006
Location: The Kop
Is your iPod an iPod Touch? It seems as if that automator action can't do them (or at least my iPhone)

Change the automator action to a simple "Run applescript" and then enter this into it

Quote:
on run {input, parameters}

try
tell application "Finder"
eject the disks
end tell
tell application "iTunes"
eject iPod
end tell
on error
display dialog "sorry something went wrong"
end try
return input
end run
Seems to work on my machine.
xUKHCx is offline   0 Reply With Quote
Old Apr 11, 2008, 11:38 AM   #3
Slip
macrumors 6502a
 
Slip's Avatar
 
Join Date: Oct 2007
Location: Wiltshire, England
On the note of the iPod, which model is it? For the Touch you don't have to eject it before removing it from the dock; that's the only thing I can think of in regards to why Automator says there's no iPod connected. Sorry for the limited help
EDIT: Beat me to it ^
__________________
Laziness is nothing more than the habit of resting before you get tired.
SR MacBook|2GHz|4GB RAM|250GB HDD

Last edited by Slip; Apr 11, 2008 at 12:34 PM.
Slip is offline   0 Reply With Quote
Old Apr 11, 2008, 11:48 AM   #4
pyles
Thread Starter
macrumors newbie
 
Join Date: Jan 2008
Quote:
Originally Posted by Slip View Post
On the note of the iPod, which model is it? For the Touch you don't have to eject it before removing it from the dock; that's the only thing I can think of in regards to why Automator says there's no iPod connected. Sorry for the limited help
Thanks sorry it is a 2nd gen iPod Nano 4gb (green to be exact ) Haha. I will try the above. Thanks for the help so far guys!

Quote:
Originally Posted by xUKHCx View Post
Is your iPod an iPod Touch? It seems as if that automator action can't do them (or at least my iPhone)

Change the automator action to a simple "Run applescript" and then enter this into it



Seems to work on my machine.
Thank you so much! Works perfectly and gets the ipod as well!

Last edited by Mitthrawnuruodo; Apr 11, 2008 at 12:05 PM. Reason: Merging, please use MULTIQOUTE to answer more than one post...
pyles is offline   0 Reply With Quote
Old Apr 11, 2008, 12:35 PM   #5
Slip
macrumors 6502a
 
Slip's Avatar
 
Join Date: Oct 2007
Location: Wiltshire, England
Quote:
Originally Posted by pyles View Post
Thanks sorry it is a 2nd gen iPod Nano 4gb (green to be exact ) Haha. I will try the above. Thanks for the help so far guys!



Thank you so much! Works perfectly and gets the ipod as well!
Glad to see it's sorted
__________________
Laziness is nothing more than the habit of resting before you get tired.
SR MacBook|2GHz|4GB RAM|250GB HDD
Slip is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Automator script not running at every login? Risco OS X Mavericks (10.9) 0 Apr 21, 2014 02:03 PM
Apple automator script nepentanova MacBook Pro 2 Mar 6, 2014 02:06 AM
nMP keeps ejecting TB devices chfilm Mac Pro 5 Feb 18, 2014 10:19 AM
Need help with Apple Script/Automator ashameer Mac Programming 1 Feb 10, 2013 05:50 PM
battery test (automator workflow script) ressac MacBook Pro 0 Sep 14, 2012 09:31 AM

Forum Jump

All times are GMT -5. The time now is 03:51 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps