# Programmatically getting the Hook URL of a Finder item

**URL:** https://discourse.hookproductivity.com/t/programmatically-getting-the-hook-url-of-a-finder-item/1330
**Category:** Bug Reports
**Created:** [March 24, 2020, 4:16pm UTC](https://discourse.hookproductivity.com/t/programmatically-getting-the-hook-url-of-a-finder-item/1330 "2020-03-24T16:16:37Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![johnsidi](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/johnsidi/32/732_2.png) [@johnsidi](https://discourse.hookproductivity.com/u/johnsidi)
#### Post date: [March 27, 2020, 10:15am UTC](https://discourse.hookproductivity.com/t/programmatically-getting-the-hook-url-of-a-finder-item/1330/6 "2020-03-27T10:15:12Z")

</div>

No, the following script still returns the file name and not the Hook URL:

```
use framework "Foundation"
use scripting additions

tell application "Finder"
	activate
	tell application "System Events"
		--activate Hook
		keystroke space using {command down, shift down}
		delay 1
		--Copy Link 
		keystroke "c" using {command down}
		delay 1
		--set the clipboard to (do shell script "pbpaste")
	end tell
end tell
return the clipboard

```

If the line “set the clipboard to (do shell script “pbpaste”)” is part of the executable code then the result is a Hook URL.

Anyway, I hope that in the future Hook will provide full scripting support (and not only for accessing its database) for itself! Then all the “hacks” that I used [in the script for getting the Hook URLs of a Finder selection](https://discourse.hookproductivity.com/t/how-to-create-markdown-rtf-html-mediawiki-latex-mathematica-links-using-hook-urls-to-one-or-more-selected-items-in-finder/1334) would not be needed and I would be able to get these and others from any other compatible app using a simple loop.

---

_[View the full topic](https://discourse.hookproductivity.com/t/programmatically-getting-the-hook-url-of-a-finder-item/1330)._
