Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kalisphoenix

macrumors 65816
Original poster
Jul 26, 2005
1,231
1
Yeah, so, I want to put all of my DVDs on my Mac mini. Not all at once, just one or two here or there. The problem is that it's a media center, so I removed the keyboard and mouse. In other words, I needed to put a DVD in and have the Mac mini rip it... automatically. But sometimes, I want to put in a DVD and just watch it. Thankfully, I learned that Front Row ignores your System Preferences-set direction for what to do when you insert a DVD. So if I want to rip a movie, I exit Front Row and insert the DVD. If I want to watch it, I just stay in Front Row -- no problem.

Anyway, I wanted to post my script on here. It's worked fine thusfar, but I'm sure there are a couple of instances where it would not work quite right (or at all). What I'd like to know is if anyone has any suggestions for making this script more foolproof, more elegant, and more efficient.

I'm a beginner at AppleScript, so please be gentle with me.

Code:
tell application "MacTheRipper"
        activate
        delay 10
end tell

tell application "System Events"
        tell process "MacTheRipper"
                tell window 1
                        click button "Go!"
                        delay 5
                end tell
        end tell
end tell

tell application "System Events"
        tell process "MacTheRipper"
                tell window 1
                        tell sheet 1
                                try
                                        click button "Continue"
                                end try
                                try
                                        click button "Ok"
                                end try
                                try
                                        click button "Open"
                                end try
                        end tell
                end tell
        end tell
end tell

set MagicNumber to 0
repeat until MagicNumber is 1
        delay 10
        tell application "System Events"
                tell process "MacTheRipper"
                        tell window 1
                                tell sheet 1
                                        try
                                                click button "Close"
                                                set MagicNumber to 1
                                        end try
                                end tell
                        end tell
                end tell
        end tell
end repeat

tell application "Finder"
        do shell script ("drutil eject")
end tell

Any ideas?
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
I'm not at my mac, but have you checked if MTR has an Applescript dictionary so you don't have to do everything with System Events?

You should be able to open MTR.app in Applescript and it should expose the dictionary, look for a Suite that has MacTheRipper in the name.

Good Luck and PS. When you are done, you should share the app!
 

bearbo

macrumors 68000
Jul 20, 2006
1,858
0
does using system events require enabling the GUI scripting? if so you probably want to mention it...

i never really got GUI scripting to work very well tho :( i'll try to learn something from this script.
 

kalisphoenix

macrumors 65816
Original poster
Jul 26, 2005
1,231
1
Sorry, folks, I was posting this in a hurry today and didn't think to mention the crap that should have been mentioned first.

1. No AS dictionary for MtR, much to my continuing frustration. I'm not sure if the next version will have an AS dictionary, because I'm not a beta tester :( Are any BTs out there that can confirm or deny this?

2. Yeah, it requires GUI scripting to work. Which is a tremendous pain in the ass.

I'm thinking about trying to cheese a few bucks so I can become a paid beta tester for MtR. At least then I'd know :-|
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.