10.4: drutil syntax has changed

Jun 03, '05 10:40:00AM

Contributed by: mark hunte

Tiger only hintI have two DVD/CD drives -- one internal one external with my G5. I've been using this AppleScript, along with Spark, to create a hotkey for opening and closing the external drive:

property drawerstatus : true

if drawerstatus is true then
  do shell script "drutil tray eject -drive external"
else
  do shell script "drutil tray close -drive external"
end if
set drawerstatus to not drawerstatus
For the internal drive, I use the eject key on the keyboard. After installing Tige,r I found that when I hit my external hotkey, both drives opened or closed.

It turns out that the drutil unix command has been change in 10.4. Instead of using drutil tray eject -drive external, you now have to use drutil -drive external tray eject. The one thing, apart from being annoying, is that if you use the old way, you can have a short script that opens and closes both drives at the same time, regardless of drive selected.

Comments (0)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050520155515566