Edit: Iāve had this installed for about ten hours now and my Hook usage has already skyrocketed. Thanks thanks for introducing me to xbar, too, canāt believe Iād not seen this before now!
Thank you very much @floflo for this contribution: as @thomasg says this script brings more usability to hook: Iām testing it and it changes the way I use hook too, but - unfortunately - Iāve detected a problem with Mozilla Firefox, with which I do a lot of linking via hook.
It turns out that when xbar with your hook.1s.sh plugin are active and āwatchingā, then the Firefox address window opens and closes intermittently, I suspect at the rate of 1second, I think, matching the 1-second āwatchā rate that I think your script does. And therefore any possibility of using the browser is blocked. I have also found that with the Brave browser this interaction does not occur.
Have I explained myself well enough? Is there a possible hook-xbar-firefox triple interaction? Is it possible to find a solution?
Now I remember that Firefoxās behaviour of displaying the address bar always occurs when invoking hook to link, so I gather that the behaviour with xbar + hook.1s.sh suggests that at a rate of 1 second the address bar is displayed and closed as if it were a continuous invocation of hook.
Hey TBerni, interesting problemā¦ i could reproduce it with Firefox.
The āGet Adressā command for Firefox uses UI-scripting-Applescript that seems to conflict with my Applescript. Not sure how/if i could resolve that, maybe the Hook developers have an idea?
I know from the developers that the level of compatibility between Firefox and Hook is not as high as that between Hook and Chromium-based browsers. In fact, I believe that the problem of the opening of the address bar - as I indicated - already exists between Firefox and Hook, what happens now with your script is that the problem becomes intractable due to the āsurveillanceā that hook.1s.sh exerts on Firefox and that determines the opening-closing-opening loopā¦ in the address bar. (I donāt know how to express it in a more technical way).
I think your plugin is great, so Iām starting to think that Iāll have to use Brave as my first choice of browser instead of Firefoxā¦ Difficult dilemma!
Itās not a Firefox specific issue. The problem is that some apps are not truly linkable (via an API), so for them Hook uses UI scripting, which involves automating interactions on the UI. (Hook Pro users can peer into Hook software integration scripts.)
Our solution will avoid this. It will only auto update the link count (in the separate window) if Hook can get the link info via automation.
Thank you very much for your explanation @LucB: I suspected some of this.
One question: do you already have a forecast of when you will be able to implement an internal solution to Hook to be able to see the links through the menu bar or by notification? In which version do you think you will introduce it?
Hi, This script isnāt usable for me. It keeps causing UI artifacts in many programs (FireFox, SideNote, etc). In a text editor, it is causing the cursor to move down the page one line at a time every second (NeoVim in a terminal). I suspect itās due to UI scripting which often has this type of effect.
yes, basically the script would need to check that Hook does not interact with the current app via UI scripting. Iād recommend checking whether the app is one of a set of apps, including Finder, DEVONthink, OmniFocus, Mail, etc.
Sorry to hear thatā¦ i tested it with the apps i use every day, but it seems that none of them are dependent on UI-Scripting. Iāll add a note up top.
Great script @floflo - thanks for making this! Since Iām not using Firefox, only Brave and Safari, this is just perfect for my work. To improve the aesthetics and usability, I changed the IF-THEN-ELSE part slightly and moved the xbar item next to the Hook icon in the menubar so it looks like this (to the left):
I find it a bit more intuitive and sleek this way.
Itās easy to change the script to whatever color you want on the figure - I prefer red because it has good contrast in both dark and light mode.
if (($count > 0))
then
echo "$count | color=red | size=14"
else
echo ""
fi
Welcome to the Hookmark Forum , @hayes1699, and thanks for asking.
Hookmark can show hook counts in its menu bar icon for AppleScript-automated apps General Preferences Tab ā Hookmark. Firefox is not link-friendly with respect to automation but plenty of apps are.