Hookmark Applescript

Hey Guys,

i have the following Problem. Let‘s say i have the following file path: “/Users/numan/Downloads/ssrn-604047 (1).pdf”.

I want Hookmark to create a Hookmark link to that file. Possibly without GUI Scripting. What i tried is to encode the filepath. However there is still a lot missing, as the Hookmark URL works as following:

“Hookmark enables you to create links to files.
Hookmark’s links to files look like this: hook://file/<?p=?n= . Hookmark is capable of tracking the file to which its links point. This is a bit like how a Finder alias can track the location of a file.”

How can i generate the id ? Or is there someone that has a already working Script.

Thanks in advance!

Welcome to Hookmark forum, @Numan .

Does this script work for you?

tell application "Finder"
	set filePath to POSIX file "/Users/abc/text.txt"--replace the path with your file path
	
	
	set fileURL to URL of file filePath
end tell

tell application "Hookmark"
	set myBookmark to make bookmark with data fileURL
	return address of myBookmark
end tell

Yes it does! Amazing!

Thank You!