Establishing the Current Cursor Position in QT timeline

After opening a quicktime film, after putting the cursor anywhere in the timeline is there a way to determine the position either in any of these ways :
which frame display on the window
what is the duration of the film at that point

Also is is possible to convert the fram numbers of a film in the TIMECODE equivalent? I know there are several apps doing this but is it possible to do it with AppleScript?

Thank you very much

Model: PowerBookPRO
Browser: Safari 523.12.2
Operating System: Mac OS X (10.4)

Hi,

try this


property TimeOffset : 10 -- SMTPE starts often with 10:00:00:00

tell application "QuickTime Player"
	tell document 1 to set {currentTime, timeScale, theDuration, FrameCount} to {current time, time scale, duration, count (frames of track "Video track")}
end tell

set FrameRate to (FrameCount * timeScale) / theDuration div 1
tell (currentTime / timeScale) to set {hr, mn, sc} to {it div hours, it mod hours div minutes, it mod hours mod minutes div 1}
set fr to (currentTime mod timeScale div (timeScale / FrameRate))
set SMPTE to addZero(TimeOffset + hr) & ":" & addZero(mn) & ":" & addZero(sc) & ":" & addZero(fr)
display dialog "TCR " & SMPTE

on addZero(v)
	return text -2 thru -1 of ("0" & v)
end addZero

Merci, Danke, Grazie Stefan …

It works very well

One more little help if I may:
Is it possible to get the result in a text file?

What I want to do ultimately is:
1 Open a Film
2 through the Applescript you suggest I can set the in and and the out point in the timeline
3 copy the selection in a new film giving it a name

Example

I have a 00:59:59:12 (SMPTE) file on my time line
with your script I determine the in point
running it again I get the out point
The result data gets copied to a text file
AppleScripts reads it
creates a selections (00:32:12:10 ---- 00:33:14:07)
copies it
opens an empty film
copies and saves the content of the clipboard as referenced files not as self contained in the empty
and names it progressively:
Maybe:
CUT_01
CUT_02
this until the text file I created ends

I have seen a number of scripts doing similar things in different areas of these forums but I am too new to Apple script to avoid the errors I get

Thanks again

Wan Dan

PS

congratulation for your musical work

CUT