QuickTime Player

Hello!

For theatre performances we use video projections. I take QT Player for the presentation.
I split monitors and play the QT movie in presentation mode (=video projector) and use the onscreen remote control on my laptop to navigate through the scenes.

Therefore I did create chapters in the movie. But in QT the only way to guide through the chapters is by opening the menu in the remote control and scroll to the next chapter. There is no way to use any keyboard shortcuts for the navigation from one chapter to another.

During our performances I sometimes have to jump from one part of the film to another without pausing or viceversa sometimes I pause and then jump to the next chapter.
Because I do have to work on the music and additional sound effects at the same time while I control the film I look for some help in the workflow.

Is it possible to get the following functions through AppleScript and does anybody know how:

  1. I do create a shortcut for each chapter: Jump to A and STOP (=keyboard short cut xy). Jump to B and STOP (=keyboard short cut xy) and so on…
  2. I do create a shortcut for each chapter: Jump to A and PLAY (=keyboard short cut xy). Jump to B and PLAY (=keyboard short cut xy) and so on…

In other words: I do like to jump out of the playing movie to special points in the movie (not necessarly chapters but timecodes, frames…) by using the keyboard. The movie then continues playing from that special point or stopps at that special point.

Is this possible and can anybody help me?
Thank you very much.

Rainer

I am using MacBook, QT Pro, Mac OS 10.4.9

This bit should help in the time code based scenario:

tell application "QuickTime Player"
	tell movie 1
		--pause
		set pointX to current time
		set current time to (pointX + 5000)
		--start
	end tell
end tell

Save the above script as application and assign a keyboard shortcut to it. (jumps 5’ooo samples? forward)
I’m not sure about the units. I guess they depend on “time scale”.

About the keyboard shortcut I recommend using triggers in Quicksilver http://quicksilver.blacktree.com/

You could also make a “Controller” App with XCode and give it a nice GUI.

Luke, thank you very much for your help- it works perfect.
It did create for every cue point an AppleScript as you mentioned. To find out the exact cue point I found an AppleScript called “chapter properties.scpt”

tell application “QuickTime Player”

activate
if not (exists movie 1) then return "no movie"
stop every movie
tell movie 1
	set this_track to current chapter track
	if this_track is not {} then
		set this_name to the name of this_track
		set this_chapter to the current chapter
		set the chapter_name to the name of this_chapter
		set the chapter_index to the index of this_chapter
		set the chapter_duration to the duration of this_chapter
		set the chapter_start to the time of this_chapter
		set the message_text to "Current Chapter Info" & return & return
		set the message_text to the message_text & "Chapter Track Name: " & this_name & return
		set the message_text to the message_text & "Current Chapter Name: " & chapter_name & return
		set the message_text to the message_text & "Current Chapter Index: " & chapter_index & return
		set the message_text to the message_text & "Current Chapter Start: " & (chapter_start as string) & return
		set the message_text to the message_text & "Current Chapter Duration: " & (chapter_duration as string)
	else
		set the message_text to "The front movie has no chapter track."
	end if
	display dialog message_text buttons {"OK"} default button 1
end tell

end tell

To activate the different scripts through keystrokes as I wished to do I then used a nice shareware called “Butler” http://www.manytricks.com.
It is very easy to create keyboard shortcuts through Butler.

Luke, thanks again.
Rainer

Hi All

I have found the above script very usefull, however whenever I run the timecode shift script it shifts from fullscreen mode. I need to be able to keep the movie running in full screen mode, and alternate the time code shifts with keybinds (using Butler app). Is there anyway to keep in fullscreen mode upon the running of each script???

Example code of the two scripts bound to keys using the excellent Butler app

--script1
tell application "QuickTime Player"
	activate
	present movie 1 scale screen
	tell movie 1
		set x to (208337)
		set y to (248337)
		select at x to y
		play
	end tell
end tell

--script2
tell application "QuickTime Player"
	activate
	present movie 1 scale screen
	tell movie 1
		set x to (106164)
		set y to (112004)
		select at x to y
		play
	end tell
end tell


Any advice here would be great,

thanks
Stu

ibook g4 1.42ghz OS X 10.4.9

my suggestion:
first script only loads the movie and presents it.
The time-shift scripts then don’t need to present again.

example first.scpt:


tell application "QuickTime Player"
	activate
	open "mymovie.mov"
	present movie 1 scale screen
	-- play movie 1 -- only needed if present wouldn't start playback
end tell

example time-shift.scpt:


tell application "QuickTime Player"
	tell movie 1
		set {x, y} to {208887, 214445}
		select at x to y
		set current time to x
		-- play --- only needed if isn't playing already
	end tell
end tell

Hello

thanks for the tips Luke, the initial “open fullscreen script” works well, but I am still having the issue of the movie window resizing from fullscreen when I run differing “time-shift” scripts, I also have the issue of the window resizing down when it reaches the “y” defined in the timescale (end of time defined time-shift). Any help appreciated.

Thanks
Stu

Model: ibook g4 1.42ghz OS X 10.4.9 QuickTime v7.1.5
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

could this have something to do with buttler? I use QuickSilver and don’t have that effect.

if you have play only selection = true, which you probably have, QT will exit presentation mode when selection end (y) has been reached.
The following lines might help. The caveat is that the script will be running until y has been reached.


tell application "QuickTime Player"
	tell movie m
		repeat until current time ≥ y
		end repeat
		pause -- or whatever you want to happen when y has been reached
	end tell
end tell

I suggest you write an XCode project that has an interface for your needs. This would possibly make some things easier (on idle → check position) while it makes all more complicated unless you are already comfortable with XCode projects.

Hi Stu!
I have a movie running in QT Player in full screen mode and skip through the movie without leaving full screen mode.
I send you the script code (thanks to Luke from SwissalpS) I am running.

I open all needed files (I am using additional sound files for my presentation) with an OpenStart.scpt:

set fileList to {alias “/user/MyMovie.mov”, alias “/user/music1.aif”, alias “/user/music2.aif”, alias “/user/music3.aif”}

tell application “QuickTime Player”
– make sure some defaults are set
set {play sound in background, open movie in new player, only front movie plays sound} to {true, true, false}
– open the files
repeat with thisFile in fileList
open thisFile
end repeat
– configure and present the main movie
tell movie “MyMovie.mov”
set {controller type, presentation mode} to {standard, normal}
set current time to 0
present scale screen display 1
pause
end tell
end tell

I created two scripts for every cue point in the movie I want to skip to.
One in “Play”- mode, the second in “Pause”- mode

– Position1_Play
tell application “QuickTime Player”
tell movie “MyMovie.mov”
play
set current time to 56808
end tell
end tell

– Position1_Pause
tell application “QuickTime Player”
tell movie “MyMovie.mov”
pause
set current time to 56808
end tell

I did write two scripts for every soundfile

– Music1_Play
tell application “QuickTime Player”
activate
open file “/user/music1.aif”
tell movie 1
set current time to 0
play
end tell
end tell

and

– Music1_Pause
tell application “QuickTime Player”
activate
open file “/user/music1.aif”
tell movie 1
set current time to 0
pause
end tell
end tell

I dragged all scripts like Position1_Play.scpt, Position1_Pause.scpt, Position2_Play.scpt, … and the scripts for the soundfiles like music1_play.scpt, music1_pause.scpt, music2_play.scpt, … and the OpenStart.scpt into Butler to create a different keystroke for each script.
I limited the shortcuts to be used only in QT.

I don’t know if these serves you but it works perfect for me.
Rainer