Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 2, 2007, 03:03 PM   #1
kalisphoenix
Banned
 
Join Date: Jul 2005
My (pseudo-)pimp Automatic MacTheRipper AppleScript

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?
kalisphoenix is offline   0 Reply With Quote
Old Feb 2, 2007, 03:51 PM   #2
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
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!
jeremy.king is offline   0 Reply With Quote
Old Feb 2, 2007, 03:56 PM   #3
bearbo
macrumors 68000
 
bearbo's Avatar
 
Join Date: Jul 2006
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.
bearbo is offline   0 Reply With Quote
Old Feb 3, 2007, 10:08 AM   #4
kalisphoenix
Thread Starter
Banned
 
Join Date: Jul 2005
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 :-|
kalisphoenix is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Automatic and Jawbone Team Up to Integrate Automatic Data Into Jawbone UP App MacRumors iOS Blog Discussion 11 May 15, 2014 02:08 PM
Pseudo-Gallery compuwar Digital Photography 2 Feb 7, 2014 07:00 PM
27" iMac achieving 1920x1080 Pseudo HiDPI mode jediDev iMac 14 Dec 3, 2013 11:55 AM
Pseudo-wiping MBP for family member, need help please. Sputnek OS X 5 Aug 2, 2013 04:40 PM
Use applescript automatic copy Specified files from new added Mobile hard disk to mac woshiysc Mac Programming 10 Feb 22, 2013 10:20 AM

Forum Jump

All times are GMT -5. The time now is 03:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC