Get Bookmark link from URL

Hello, I hope the following question will make sense:
I am using PDF Expert and was happy to find a script for creating links to different pages using Hookmark. This works amazingly when I want to reference a certain page (and I often use Hookmark this way to paste the link to a given document), however, usually I just want to link to the main document without specific page number. I was wondering whether there is a neat way to just link to the document as a default and get the link to a specific page number when needed.
My current thinking is to use keyboard maestro and run the script found in the link above from there, however, this will only return a markdown link to the file, which will then show the file in finder when clicked, rather than opening the page. Is there a way to pass this to Hookmark to create a bookmark that can be stored in my clipboard? This seems to be essentially what Hookmark does anyway, but I am not sure how to make this happen I this case.
An example of the URL that I want to convert to a bookmark: file:///Users/mb/Library/CloudStorage/OneDrive-Personal/Uni%20Hagen/01141%20Mathematische%20Grundlagen/MaGruLa%20Skript.pdf?p=226#p=226

Thank you for contacting us!

To convert a file URL to a bookmark:

tell application "Hookmark"
	set myURL to "file:///Users/asdb/test/test.txt"
	
	set b1 to make bookmark with properties {address:myURL}
end tell

Could you please turn off “Reveal hook://file link targets in Finder(…)” and see if it helps?

Thank you

Hello,
Thank you so much for your reply. This works well for creating bookmark links now, which open the file in the app if I pass the URL that I got from the other script. In this case, however, the page reference seems to be gone. Is there an additional command that then tells Hookmark to open the link with the PDF Expert’s “Open Item” script? What other properties could I pass hookmark so that it will essentially do what it always does, but with a different ‘get address’ script?
Thank you again,
Max

Please try this:

tell application "Hookmark"
	set myURL to "file:///Users/asd/test/test.txt"
	
	set b1 to make bookmark with properties {address:myURL ,name:"my title"}
	
	set myURL to "open -a Hookmark \"" & address of b1 & "\""
	do shell script myURL
end tell

Thank you for your very fast response. Just to double check- I replace the URL with my own file, is that correct?
In this case the program will open the correct file, but it still does not seem to open the correct page number.
‘do shell script’ is only there to open the URL, is that correct? Is there a list of what other properties ‘make bookmark’ take?

---- EDIT----
Actually it seems to work now, I am not sure what I had done wrong in the first place. Thank you for your help.
If you have the time, I would still like to ask how I can then edit the bookmark item to include the name- currently the bookmark item ‘b1’ return

Sorry, I just corrected the script in the previous post. It has problem. You must have made the right change.

I also include the name for bookmark creation. But currently file name can’t be changed by script.

Thank you