I want to show how many links are connected to my current frontmost app using the Applescript via SketchyBar (I prefer to keep my menubar hidden), but I noticed that basically every time it runs it adds a new bookmark to Hook’s list.
- I’m fine with it for the most part but I’m concerned it might be an issue long-term as the bookmark list is updated everytime I’m basically on any new document or new webpage. Is it okay to let the bookmark list grow huge performance-wise?
- Is there another way of pulling the count of hooked bookmarks via Applescript that doesn’t add a new bookmark?
I went through some past discussions on here (new user, can’t link) but I’m wondering if there are any updates or thoughts on this.
try
tell application "Hook"
set bookmarkOrHandle to bookmark from active window
if class of bookmarkOrHandle is text then
set bookmarkItem to bookmark by request handle bookmarkOrHandle
else
set bookmarkItem to bookmarkOrHandle
end if
set bookmarkList to hooked bookmarks of bookmarkItem
set HOOKMARK_BOOKMARKS_COUNT to count of bookmarkList
end tell
on error errMsg number errNum
set HOOKMARK_BOOKMARKS_COUNT to 0
log "Error: " & errMsg & " (" & errNum & ")"
end try
return HOOKMARK_BOOKMARKS_COUNT