Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Jump to the beginning of a movie in DVD Player Apps
I hate all the copyright stuff and other unimportant notices on DVDs. When I launch DVD Player, I like to jump straight to the film. So I find the following AppleScript to be awfully useful for me.
tell application "DVD Player" to activate
my quickstart()

on quickstart()
  tell application "DVD Player"
    set time_left to the remaining time
    if (time_left < 1500) then
      set elapsed time to 1500
      delay 1
      press enter key
      my quickstart()
    end if
  end tell
end quickstart
[robg adds: I haven't tested this one...]
    •    
  • Currently 3.00 / 5
  You rated: 4 / 5 (5 votes cast)
 
[9,210 views]  

Jump to the beginning of a movie in DVD Player | 9 comments | Create New Account
Click here to return to the 'Jump to the beginning of a movie in DVD Player' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Doesn't seem to work
Authored by: Graff on Jun 24, '04 08:55:41PM

I just tried it with a DVD under Mac OS X 10.3.4 using DVD Player 4.0 and the hint doesn't seem to do anything but get caught in a recursive loop.

I tried making my own AppleScript to skip through the mandatory intro on my Willow DVD and it seems like every AppleScript command that would skip through the intro has been blocked. I tried the following commands every which way I could imagine:

set remaining time to 0

fast forward dvd

go to main menu

go to title menu

go to subpicture menu

go to audio menu

go to angle menu

go to ptt menu

go return to dvd

- Graff



[ Reply to This | # ]
Interface Designers Blew It
Authored by: schneb on Jun 25, '04 10:21:39AM

DVDs have one BIG flaw, and that is all the warning and copyright front-ends. The way a DVD should work is...

Insert the DVD and the movie starts.
Press MENU and you are sent to the menu.
On the menu there is a selection called "Copyright" where all the warnings reside. It is there and thus you are responsible and liable.

Forcing people to have to wait through it will only make the owner mad and look for a way to COPY it, just to avoid seeing it. It works totally against what they are trying to prevent. How dumb is that?



[ Reply to This | # ]
VLC?
Authored by: Lectrick on Jun 25, '04 07:57:44PM

I wonder if Videolan Client ignores this delay, since I know it will open dvd's even on external drives that Apple's DVD Player doesn't normally support. I don't have a DVD lying around to check, but it might be an option ;)

OR... just rip the infernal thing with HandBrake ;)

---
In /dev/null, no one can hear you scream



[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: Cameroon on Jun 27, '04 08:33:33PM

I've got what I think is a better method, but it does have one catch. DVD Player cannot be running when you run the script, or it won't work as expected. The comment in-code pretty much explains it.

I don't know for sure why it works, but it does. I think it has something to do with catching the player or DVD "off-guard".

I wonder if it's possible to get this script to run (instead of DVD Player) when a DVD is inserted? That might be pretty darn handy.


tell application "DVD Player"
	(* this won't work as desired if DVD Player is
	already running when we get to this point
	when given the series of commands this quickly
	DVD Player will skip past all the unwanted crap and menus
	that are becoming more common on DVDs.
	This is perfect becuase then we don't have to come up
	with some funky logic that may or may not play the movie
	as expected *)
	activate
	try
		set title to 1
	on error
		quit
	end try
	play dvd
end tell


[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: Graff on Jun 29, '04 09:36:04AM

Sure, it's easy to get a script to run when you insert a DVD. Here's how:

  1. go to System Preferences -> CDs & DVDs
  2. click on the pop-up menu "When you insert a video DVD"
  3. choose "Run script..." from the menu
  4. select the script to run

Now every time you insert a video CD the script will run instead of DVD Player being opened.

- Graff



[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: Safar on Jun 28, '04 06:12:31PM
whow ! i had posted this hint 2 or 3 months ago. anyway, i improved the script : this should be much better because it is protected against loops

tell application "DVD Player" to activate
my quickstart(72)

on quickstart(compteur)
	tell application "DVD Player"
		set time_elapsed to the elapsed time
		set title_length to the title length
		set good_time to (title_length - 1) as integer
		if (title_length < 1500) and (title_length > 7) then
			set elapsed time to good_time as integer
		end if
		set time_elapsed to elapsed time
		if (time_elapsed = compteur) then
			delay (time_elapsed + 1)
		end if
		if (title_length < 1500) then
			press enter key
			delay 1
			my quickstart(time_elapsed)
		end if
	end tell
end quickstart


[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: Arif on Jun 28, '04 09:30:29PM

I've found Cameroon's version to by far be the most stable and best. I've made some simple changes, to start a dialog and ask whether you want to do it before you go ahead with doing it, this way, when you save as a run only application, and in your preferences set your newly made application to run whenever a video DVD is inserted, you can still have the choice to run as normal or cancel.

[code]

display dialog "Do you want to go straight to the film?" buttons {"Cancel", "No", "Yes"} default button {"Yes"}

if button returned of result = "Yes" then
tell application "DVD Player"
(* this won't work as desired if DVD Player is
already running when we get to this point
when given the series of commands this quickly
DVD Player will skip past all the unwanted crap and menus
that are becoming more common on DVDs.
This is perfect becuase then we don't have to come up
with some funky logic that may or may not play the movie
as expected *)
activate
try
set title to 1
on error
quit
end try
play dvd
end tell
else if button returned of result = "No" then
tell application "DVD Player"
activate
play dvd
end tell
else
tell current application
quit
end tell
end if

[/code]



[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: Arif on Jun 28, '04 10:01:11PM

My apologies, I've already revised it. It is better to save it as a compiled script, select system preferences to open script when Video DVD inserted, with the following code:

[code]

display dialog "Do you want to go straight to the film?" buttons {"Cancel", "No", "Yes"} default button {"Yes"}
if button returned of result = "Yes" then
tell application "DVD Player"
(* this won't work as desired if DVD Player is
already running when we get to this point
when given the series of commands this quickly
DVD Player will skip past all the unwanted crap and menus
that are becoming more common on DVDs.
This is perfect becuase then we don't have to come up
with some funky logic that may or may not play the movie
as expected *)
activate
try
set title to 1
on error
quit
end try
play dvd
end tell
else if button returned of result = "No" then
tell application "DVD Player"
activate
play dvd
end tell
else if button returned of result = "Cancel" then
end if
end

[/code]



[ Reply to This | # ]
Jump to the beginning of a movie in DVD Player
Authored by: CompositionB on Mar 12, '05 01:31:26PM

Three questions about your code:

1. When I insert a DVD the dialog pops up, but is not active, so it takes two clicks to make a selection and pressing return doesn't work for "yes" (unless I click and then press it). I'm guessing this is just the lack of a keyword in the dialog command or one additional line of code to activate the dialog box, but with my limited scripting ability I couldn't tell you what's missing.

2. Why did you revise the final "else" to check for the cancel button instead of just exiting on anything other than a yes or no?

3. Why do you recommend saving the code as a compiled script? I have it saved as a normal script, and set to run when a DVD is inserted. It doesn't bring up the script editor, just runs like you'd expect. I see no benefit to saving it as an application and if I'm not mistaken doing so would make the script un-editable.



[ Reply to This | # ]