Rules for an inserted DVD

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Rules for an inserted DVD Fri Jun 07, 2013 12:44 pm • by GeekNeck
Hi all,

I'm trying to use Hazel to copy files from a DVD to my hard drive whenever the DVD is inserted. The rules work just fine when I execute them manually. The problem is that Hazel takes an eternity (around 30 minutes!) to kick in once the DVD is inserted.

I am having Hazel watch the /Volumes folder, then have a rule that verifies it is the appropriate DVD. It does finally run, but the idea was to be able to insert a DVD from a stack, have the files pulled by Hazel, then move on to the next DVD, all in rapid succession.

I'm guessing that watching /Volumes is a bit of a hack on my part, but its the only way I can think of to do it. Any thoughts would be greatly appreciated!

Paul

PS
If I wanted the disc to be ejected after Hazel is done copying the files, I suppose I'd have Hazel run an AppleScript to do the job as the last rule. Is there any better way to do that?
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am

Re: Rules for an inserted DVD Fri Jun 07, 2013 1:50 pm • by sjk
GeekNeck wrote:If I wanted the disc to be ejected after Hazel is done copying the files, I suppose I'd have Hazel run an AppleScript to do the job as the last rule. Is there any better way to do that?

I'd use an embedded one-line shell script, e.g.:

Code: Select all
/usr/sbin/drutil eject

The drutil man page documents other verbs/options. Or output from typing drutil in a Terminal shell might be sufficiently helpful to figure it out what'll work with the optical drive on your system and it's easy to test before getting Hazel involved.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Rules for an inserted DVD Fri Jun 07, 2013 2:43 pm • by GeekNeck
sjk wrote:I'd use an embedded one-line shell script, e.g.:

Code: Select all
/usr/sbin/drutil eject


A most excellent solution, sjk!

There is almost always a way to do what you want on the command line, although it it is not always obvious. Coming from a Linux background where there is a simple "eject" command, I had considered this route, but could not find a suitable solution. "man -k eject" was fruitless! I wish there was some compendium of useful OSX commands somewhere (other than man pages)...

Thanks again for your response!
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am

Re: Rules for an inserted DVD Fri Jun 07, 2013 2:50 pm • by GeekNeck
GeekNeck wrote:The rules work just fine when I execute them manually. The problem is that Hazel takes an eternity (around 30 minutes!) to kick in once the DVD is inserted.


Well, I'll be darned! Having the Hazel window open seems to be the problem! I first noticed this when the DVD would not eject with the Hazel pref pane open. I closed it and was able to successfully eject the disk. With the pref pane closed, my rules ran fine, just a few seconds after I inserted the DVD. Go figure...
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am

Re: Rules for an inserted DVD Fri Jun 07, 2013 3:15 pm • by Mr_Noodle
Are any of your rules referencing folders on the DVD? If so, then having Hazel open will indicate that the folder is in use and will prevent ejection.
Mr_Noodle
Site Admin
 
Posts: 11951
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rules for an inserted DVD Fri Jun 07, 2013 5:23 pm • by sjk
GeekNeck wrote:"man -k eject" was fruitless!

I tried that, too, anticipating fruitlessness… before resorting to a web search to jog my memory for the name of that command I hadn't used in years. :lol:

I wish there was some compendium of useful OSX commands somewhere (other than man pages)...

Some web searching will reveal scattered lists and discussions of shell-level commands people consider useful, e.g.:

What are useful Command-line Commands on Mac OS X? - Server Fault

The page has some less common ones, most which aren't intended to be run interactively and more OS X-specific than other lists:

Description of Mac OS X processes : by triviaware

And a classic favorite of mine:

Mac OS X Hacking Tools

There's still a wealth of useful, interesting information (outdated or not) from Amit Singh on that site. I've been eagerly awaiting more news from osmeta, where he's President and CEO.
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Rules for an inserted DVD Mon Jun 10, 2013 12:01 pm • by GeekNeck
sjk wrote:Some web searching will reveal scattered lists and discussions of shell-level commands people consider useful, e.g.:

Excellent links. Thanks!
GeekNeck
 
Posts: 27
Joined: Sat Aug 11, 2012 7:26 am


Return to Support