Script to copy the name of a DVD?

Hey guys,

As mentioned in another thread, I’m currently archiving my DVD library to use within Plex. Ideally, I’d like to insert a DVD into my MacBook, then not press a single button and have it ripped to my library.

I’ve more or less got it sorted, apart from one thing. Currently, in order to start the process, you have to type the name of the movie into a text box. This is then copied to the clipboard and used later on in my automator workflow. What I’d like to happen is that instead of typing that, the name of the DVD is copied to the clipboard automatically, instead of having to type a thing.

Is it possible to write a script that will take the name of a DVD and then copy it to the clipboard? Or even something I can drop in before a “copy to clipboard” action in automator?

Any help would be greatly appreciated!


plain vanilla AppleScript is not able to receive any notifications.
To detect a mounted device you could use a launchd agent which observes the folder /Volumes

To gather the name of a mounted CD or DVD is not very reliable with AppleScript,
I wrote a Foundation Tool CLI for this purpose, which uses diskarbitration framework.
You can find it here

That’s fantastic! :slight_smile: Running that as a shell script in Automator does exactly what I want it to do. Adding a “copy to clipboard” action straight afterwards makes it perfect :slight_smile: Thankyou so much!