# AppleScript API: Missing Hooked Bookmark

**URL:** https://discourse.hookproductivity.com/t/applescript-api-missing-hooked-bookmark/5204
**Category:** Share Hookmark automation
**Created:** [June 8, 2022, 4:28pm UTC](https://discourse.hookproductivity.com/t/applescript-api-missing-hooked-bookmark/5204 "2022-06-08T16:28:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![neuon2003](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/n/46a35a/32.png) [@neuon2003](https://discourse.hookproductivity.com/u/neuon2003)
#### Post date: [June 8, 2022, 4:28pm UTC](https://discourse.hookproductivity.com/t/applescript-api-missing-hooked-bookmark/5204/1 "2022-06-08T16:28:19Z")

</div>

Getting the id for a missing linked bookmark (e.g. “hook://file/hJtiIWoYy?p=Lw==&n=(null)”) raises an error:

`Error: no such object (e.g. specifier asked for the 3rd, but there are only 2) (errAENoSuchObject:-1728).`

The Hook context window handles this gracefully as it can still access the name and path of the missing file (“Cannot locate file x”).

Can anyone suggest how the name and path properties can be accessed using AppleScript so a programmatic solution can be offered? Every method I have tried fails, because the Bookmark id/URL is invalid.

---

<div class="post-metadata">

### Author: ![neuon2003](https://discourse.hookproductivity.com/letter_avatar_proxy/v4/letter/n/46a35a/32.png) [@neuon2003](https://discourse.hookproductivity.com/u/neuon2003)
#### Post date: [June 19, 2022, 9:16am UTC](https://discourse.hookproductivity.com/t/applescript-api-missing-hooked-bookmark/5204/2 "2022-06-19T09:16:36Z")

</div>

Just to close this; might help someone. I found a way:

The text of an example error message returns: `-- "Hook got an error: Can’t get bookmark id \"hook://file/ksd4I5RGl?p=Lw==&n=(null)\"."`

Solution is:

1. Parse the error message for the coded file alias `ksd4I5RGl`
2. Search Hook for the matching bookmark `set _result to (every bookmark whose address contains ksd4I5RGl)`
3. Get data for missing hooked bookmark from there
