# QuickTime Player timestamp extension

**URL:** <https://discourse.hookproductivity.com/t/quicktime-player-timestamp-extension/3500>\
**Category:** Share Hookmark automation\
**Created:** [July 18, 2021, 5:00pm UTC](https://discourse.hookproductivity.com/t/quicktime-player-timestamp-extension/3500 "2021-07-18T17:00:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevelw](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@stevelw](https://discourse.hookproductivity.com/u/stevelw)\
**Post date:** [July 18, 2021, 5:00pm UTC](https://discourse.hookproductivity.com/t/quicktime-player-timestamp-extension/3500/1 "2021-07-18T17:00:45Z")

</div>

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”**

```auto
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

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

```

# Get Address

```auto
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

```

---

<div class="post-metadata">

**Author:** ![bchend](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@bchend](https://discourse.hookproductivity.com/u/bchend)\
**Post date:** [November 18, 2021, 10:01pm UTC](https://discourse.hookproductivity.com/t/quicktime-player-timestamp-extension/3500/2 "2021-11-18T22:01:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)\
**Post date:** [November 23, 2021, 11:33pm UTC](https://discourse.hookproductivity.com/t/quicktime-player-timestamp-extension/3500/3 "2021-11-23T23:33:52Z")

</div>

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