Hook doesn't work with VSCode

Hi!

Yes, I’ve had issues, before, then it somehow started working. Maybe after a system update. Most recently, the issue arose after bcoming interested in creating deep links using vsCode’s url scheme which, per OliverBalfour’s comment , accepts colon delimited row and column info. To me, this seems like a url protocol that could enable deep hooklinks to docs opened in vsCode.

The reason I am raising this here, in this thread, is because attempting to enable it with scripting breaks Hook’s ability to detect vsCode docs, resulting in “No linkable item found” messages, thereafter. And the kicker is that this stays broken even once you reset the scripts back to their defaults. And after you toggle Hookmark’s automation permissions off and back on, reset its Accessibility permissions, restart, etc. I am no longer willing to touch it after running two system updates to get it back working. Suffice to say, having made the mistake of editing the script again after the first update corrected it, I was lucky a sonoma patch was available immediately after.

To justify my attempt at scripting, it is probably worth noting that vsCode supports all manner of document formats – many natively, but a pile more through its endless vast extension marketplace. Also, it’s free, and built on an open source platform with a corresponding open source version, vsCodium, that boasts everything but the proprietary Microsoft extensions. But I digress…

The point, here, is that vsCode is the world’s MOST USED IDE, and its url scheme supports linking directly to a given row and column within a document. And finder and browsers can already resolve these links. Therefore, my feeling is that it is worth a shot to figure out how to enable Hookmark, with all its access permissions and brilliantly resilient links, to process links formatted as hooklink:row:col when resolving paths for which vscode is the default opener.

However, I don’t know what’s on the roadmap, and whether such functionality would be considered a priority. But in order to avoid having to update my os with every attempt to implement this, I’m asking: what appleScript will satisfy the “(vs)Code requires a ‘get Url’ script” requirement in the “Open Item” tab of the scripting pane for vsCode? Because, for reasons unknown to me (but likely known by you), a “Get Url” script must evidently replace the existing hooklink creation facility, which already works, kind of, in order for the custom url scheme to be implemented in “Get Item”.

In summary, if the “Get Address” requirement can be satisfied/bypassed with a bare bones script or verbatim copy of whatever existing logic is used under the hood – and which sometimes works out of the box, barring failed edits and the ineffective reset mechanism – then it seems the last step would be simple: parse the clicked-on hook url into 1) the hook link and 2) any manually-appended row and column suffix, then sandwich the resolved file path between ‘vscode://file:’ and the column and row suffix parsed from the original link and… Voila! Deep hooklinks to docs opened in vscode.

Can you recommend an applescript to accomplish this parsing and reconstruction of a link url for the “Open Item” tab, and one to satisfy the “Get Url” prerequisite?

Thanks for any help,
Ben