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


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.
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 | # ]