Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > DVD Player AppleScript Question

DVD Player AppleScript Question
Thread Tools
DoctorW
Forum Regular
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jul 6, 2004, 09:12 PM
 
I'll admit my experience with AppleScript is limited to opening script editor to see what it looks like, so I don't even know if this is possible, but...

What I would like to be able to do is set up a script to have in the menu that will jump to another specific track and chapter in the movie, then, when that chapter is done, jump back to the original, right where it left off. (I could do the same with just tracks, if it makes it any easier.)

It's for a presentation I'm giving, and if you're wondering what I'm using DVD player it's because although I'm running the presentation off of my laptop, it will be shown on a TV and video quality is vital.

Please keep my level of experience in mind when explaining this to me, and thanks in advance for any help.
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 7, 2004, 05:44 AM
 
Hi,

This script doesn't do exactly what you wanted - (it won't auto jump back once the chapter is complete - but when the script is run again.)

[php]
property targetPoint : 4000 -- Time in seconds where you want to jump forwaard to
property leavingPoint : 0
property weAreForward : false


tell application "DVD Player"
-- Check for disc
if has media is not true then
display dialog "There is no DVD in the Drive!" buttons {"OK"} default button 1
return
end if

-- Are we forward or back?
if weAreForward then
activate
set elapsed time to leavingPoint
play dvd
set leavingPoint to 0
set weAreForward to false
else
activate
set leavingPoint to elapsed time
set elapsed time to targetPoint
play dvd
set weAreForward to true
end if

end tell
[/php]


to get the time you want (instead to 4000 use the following script

[php]
tell application "DVD Player" to display dialog "Elapsed Time at this point: " & elapsed time
[/php]
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 7, 2004, 06:05 AM
 
Here's another version that acts more as you wished - although I'm not sure what would happen if the chapter you jump to is the last...

[php]
property targetPoint : 3015
-- Time in seconds where you want to jump forward to


tell application "DVD Player"
activate
set leavingPoint to elapsed time
set elapsed time to targetPoint
play dvd

-- Check we are still in the right chapter
set forwardChapter to get chapter
repeat while (forwardChapter is equal to the chapter)
delay 4
end repeat

set elapsed time to leavingPoint
end tell
[/php]
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 8, 2004, 05:32 AM
 
any use?
     
DoctorW  (op)
Forum Regular
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jul 8, 2004, 11:44 PM
 
I put them in the AppleScript folder (~/Library/Application Support/DVD Player Scripts), but they don't show up in the AppleScript menu.
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 9, 2004, 06:58 AM
 
Originally posted by DoctorW:
I put them in the AppleScript folder (~/Library/Application Support/DVD Player Scripts), but they don't show up in the AppleScript menu.
Applescripts in that folder need a special form of name - where the first character is their position:

rename it "12DVD Jumper" or something...
     
DoctorW  (op)
Forum Regular
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Jul 24, 2004, 11:10 AM
 
I still couldn't get them to work. It's probably my fault; I'm rather the dumbass when it comes to instructing the computer.

Thanks anyway, though!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:06 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,