QuickTime Player timestamp extension

This set of scripts adds timestamps to hooks in QuickTime Player. That way, if you do a Hook to New then the new note will be linked to that time, or if you manually add links to a note they will also be linked to the relevant times.

Unfortunately, this script (I think) loses track of files if they are moved — @LucB is that right? Is there a way to access Hook’s secret sauce to locate a file instead of relying on the path? This also means the links won’t work on another machine, unless the video is in the same location.

Please let me know if this works for you and any suggestions for improvements.

Open Item

Remember to set the url scheme to "quicktime"

set AppleScript's text item delimiters to "UUID="
set theItems to every text item of "$0"
set AppleScript's text item delimiters to ""
set theTime to text 18 thru -1 of the first item of theItems
set encodedUUID to the last item of theItems
set theUUID to do shell script "python -c \"import urllib, sys; print (urllib.unquote(sys.argv[1]))\" " & quoted form of encodedUUID
tell application "QuickTime Player"
	open file (theUUID as POSIX file as text)
	set current time of the front document to theTime
end tell

Get Name

tell application "QuickTime Player"
	return name of front document
end tell

Get Address

tell application "QuickTime Player"
	set theVideo to the front document
	set theTime to theVideo's current time
	set theFile to file of theVideo
	set theUUID to POSIX path of theFile
	set encodedUUID to do shell script "python -c \"import urllib, sys; print (urllib.quote(sys.argv[1]))\" " & quoted form of theUUID
	return "quicktime://time=" & theTime & "UUID=" & encodedUUID
end tell

Hi Steve,

Sorry for late reply!

Thank you very much for your script! We just publish it on our script server(version 187). It will use the url file://… so Hook can keep track of them.

Please let us know if there is any problem.

Thank you

Bi Ling

1 Like

Bi Ling meant hook://file/ URL scheme.