Need help running a Python script when DVD inserted

We had an intern that created a custom Python script to rip our old event recording DVDs back to a digital format. The script creates a JSON description file and asks a set of questions to create the metadata in the JSON file (e.g. Date of event).


The way the intern set this up was that you'd click on the Python script which would open a terminal window where you fill in the metadata. It then asks if the DVD is in the computer. At this point you place the DVD in. A few seconds later, the Python script notices the DVD and proceeds to rip the DVD at our specific file size requirements along with the inputted metadata.


We then upgraded the Mac from Mountain Lion to Lion and the script stopped working. Our intern has since left. I have now moved the Python script onto my Mountain Lion Mac. The intern's last message to me was that he had written an AppleScript that ran when the DVD was inserted which then referred to the Python script. The intern has since stopped replying to emails.


This is a very important project that I would like to continue. Any help would be greatly appreciated!

Mac Pro, OS X Mountain Lion (10.8.2)

Posted on Feb 7, 2013 8:41 AM

Reply
9 replies

Feb 7, 2013 1:42 PM in response to twtwtw

Nope! I sent him a copy of all the files I was able to track down. I'm on a completely different computer now (easier for me to complete this project at my own desk), so there is no pre-existing file to trip me up.


The only AppleScript I've found says this inside:


python /Users/medialab/dvddrip rename


The name of the python script is dvdrip.py. The above AppleScript is from an older version of his tinkering around.

Feb 11, 2013 11:58 AM in response to twtwtw

I just took that AppleScript he wrote and tweaked it to point to the location the dvdrip.py script is located at (not sure if I should remove "rename" off the end or not). However, when I go into Preferences > CD/DVD > and try to select this AppleScript to run when a DVD is inserted, I cannot highlight the AppleScript.


The Python script is still running. If I open Terminal and drag the icon in, I get the "Please enter the following information...." prompt.


I really appreciate you taking the time to help me figure this out!

Feb 12, 2013 8:42 AM in response to DLSupport20

well, oddly, that should never have worked. 😕


Try this: open the applescript editor, copy in the following line:


tell application "Terminal"

do script "python /Users/medialab/dvddrip rename"

activate

end tell


Save it, making sure that the 'File Format' pull down says Script (the new file will have a '.scpt' extension). You'll be able to select that file in the cd/dvd preferences.


I assumed that you wanted this to open in terminal so that you can enter options on the command line. If that's not correct, let me know.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Need help running a Python script when DVD inserted

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.