1 I run my script which returns the data in the display dialogue
2 Convert the text I read in the display dialogue to the clipboard
3 Enter some additional text
4 Add this text to the content of the clipboard and write it to a text file
5 Get the option to enter additional data repeating the script or saving the text file with a name.
the script I have (thanks to the help of several kind people in this community) returns various data from a JPEG file
it works perfectly but I can only vizualize the data in the Display Dialogue window
Model: MACBOOK PRO
Browser: Safari 525.13
Operating System: Mac OS X (10.4)
This is the script I found:
property TimeOffset : 0 (changed from 10 as I use 0 instead)
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
can I get the result in a text file.
Why?
because using this script I would be able to create a catalogue of film selections I use for later editing
Hi, this writes the result into a text file “timeFile.txt” on desktop
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(hr) & ":" & addZero(mn) & ":" & addZero(sc) & ":" & addZero(fr)
set targetFile to ((path to desktop as text) & "timeFile.txt")
write_to_disk from SMPTE & return into targetFile
on addZero(v)
return text -2 thru -1 of ("0" & v)
end addZero
on write_to_disk from theData into theFile
try
set ff to open for access file theFile with write permission
write theData to ff starting at eof
close access ff
return true
on error
try
close access file theFile
end try
return false
end try
end write_to_disk
Thank you very much Stephan, it works very well. I am very grateful to you because I’ve tried to ask help for almost one year in this matter but none of my post ever got a reply. You must be a very kind man and certainly a very good musician … my german is very bad, but I read as much as I could in your site.
Last question: is there a way to paste all the various films into one as a references movie?
I’ve tried as follows but it does not work:
set destFolder to choose folder with prompt (clips)
copy (list folder (destFolder) without invisibles) to clipList
repeat with i from 1 to count of clipList
tell application “Quicktime Player”
open file i
select all
copy
close saving no
make new document
tell document 1
paste
save
end tell
end repeat
In fact I lack experirence and time to understand the Quicktime dictionary …
If you could help it would be great