Integration with Hookmark causes Hookmark window to popup

Luc Beaudoin's Avatar

Luc Beaudoin

26 Mar, 2023 05:27 PM

// Please enter a detailed description of the issue // Description of the issue:

When I save a file that is open in Marked, Hookmark window poups up. Marked has code to check whether a markdown image uses a hook://file/ link. The fact that Hook was renamed to Hookmark seems to be causing this problem with that integration.

// Please enter a list of steps required to reproduce the issue // Steps to reproduce:

  1. Make sure Hookmark app is installed (such as Version 5.0.2 (5331; Integration v. 268))
  2. preview file foo.txt in Marked.
  3. in BBEdit, save the file.

Expected result: Marked updates the file.

Marked updates the file and invokes Hookmark.

This is an issue into which Trickster also ran: RE: Hookmark randomly invoking itself on Ventura - Hookmark Forum. I remember you (Brett) mentioned that you encountered an issue with Hookmark randomly popping up when Hook was rebranded as Hookmark. I assume this was the cause.

The solution is to ensure that the code in Marked to invoke Hookmark references "Hookmark" rather than "Hook", or (perhaps better) uses Hookmark's bundle ID. But we have 2 bundle IDs:

com.cogsciapps.hook or com.cogsciapps.hook.setapp

I don't know why I just started seeing this issue, given that I use Hookmark and Marked all the time. Someone else here at CogSci Apps was able to reproduce the issue.

// If applicable please attach a sample document that causes the issue for you.

// Configuration (do not edit) Marked 2 1040 (Setapp)

macOS Version: 12.6.3

additionalMathJaxConfig:
allowPageBreakInCode: YES
bookTxtIsLeanpub: NO
summaryMdIsGitBook: NO
codeIsPoetry: NO
codeCanWrap: YES
collapsibleHeadlines: NO
convertGithubCheckboxes: YES
convertGithubEmoji: YES
convertYAMLToMMD: NO
defaultMathJaxConfig: TeX-AMS-MML_HTMLorMML
defaultPreviewStyle: 100
defaultProcessor: MultiMarkdown
enableMiniMap: NO
excludeBlockQuotesFromCounts: NO
excludeFootnotesFromCounts: NO
excludeVerbatimFromCounts: NO
excludeCaptionsFromCounts: NO
folderPreviewExtensionsArray: md, markdown, txt, mdown, html, opml
githubNewlines: YES
h1IsPageBreak: NO
h2IsPageBreak: NO
hrIsPageBreak: NO
includeMathJax: NO
includeKatex: NO
limitTextWidth: NO
mathNumberEquations: NO
mathNumberEquationsSide: 0
mathNumberEquationsAMSOnly: NO
minimalJavaScript: NO
outlineModeExtensions:
permissionGranted: NO
printHeaderBottomLeft:
printHeaderBottomRight:
printHeaderFirstPage: NO
printFooterFirstPage: NO
printHeaderTopLeft:
printHeaderTopRight:
processHTMLFiles: YES
removeMetadataForPreview: NO
removeYAMLHeaders: NO
scrollToEdit: NO
shouldDetectCritic: YES
shouldHighlightMarkupErrors: NO
shouldLoadCritic: NO
syntaxHighlight: YES
syntaxHighlightOnlyLang: NO
useCustomMarkdownProcessor: NO
customMarkdownProcessor:
useCustomPreprocessor: NO
customPreprocessor:
useFirstH1AsPrintTitle: YES

  1. Support Staff 1 Posted by Brett on 27 Mar, 2023 03:55 PM

    Brett's Avatar

    I'm on vacation for a week but will look into this as soon as I'm back. I had seen this happen on one machine, but was unable to replicate it on another, so at the time it seemed like an isolated bug. Should be fixable when I have time to tackle it.

    -Brett

    On 26 Mar 2023, at 13:29, Luc Beaudoin wrote:

  2. 2 Posted by Luc on 27 Mar, 2023 07:14 PM

    Luc's Avatar

    Here's our analysis of the situation:

    (1)If “Hook.app” is running, then no Hookmark window popup and the script is executed. (2)If neither “Hookmark.app” nor “Hook.app” is running, system will try to locate Hook.app, launch it and execute the code. If it can’t find Hook.app, it will pop up a window with a list of apps and ask the user to select one (3)If “Hookmark” is running, and Hook.app does not exists then executing the above code will see a window with a list of apps for the user to choose. (4)If “Hookmark” is running, and Hook.app exists then execute the above code will open Hookmark window. I guess the system is trying to launch “Hook.app”, and the launching send an event to “Hookmark” which invoke applicationShouldHandleReopen function, which opens Hookmark window

    In sum, if a user runs both Hookmark.app and the AppleScript gets involved (by Marked Trickster, etc.), and has previous Hook.app on their Mac, they will see this problem.

  3. Support Staff 3 Posted by Brett on 28 Mar, 2023 01:49 PM

    Brett's Avatar

    Hey Luc,

    Putting a little morning coding time into that Hookmark/Marked issue on my vacation here, but for some reason my Hookmark license isn't working. I open it in basic mode and then click the link I have, it says Thanks for Buying Hookmark, I hit ok, but then I try to run the Screenshot Shortcut and it tells me Shortcuts are only available to Pro users… tried quitting and restarting Hookmark, doesn't seem to help, and next time I launch it it tells me my trial has expired. I don't work on this particular machine much, but it did have a recent copy of Hookmark on it, so I assume I had it registered in the past. Any tips?

    Thanks,
    Brett

  4. Support Staff 4 Posted by Brett on 28 Mar, 2023 01:53 PM

    Brett's Avatar

    Never mind, I think I got it. Was clicking an older Updates License link I had, clicking the newer one and then restarting Hook seems to have registered it.

    On 28 Mar 2023, at 9:49, Brett Terpstra wrote:

    > Hey Luc,
    >
    > Putting a little morning coding time into that Hookmark/Marked issue on my vacation here, but for some reason my Hookmark license isn't working. I open it in basic mode and then click the link I have, it says Thanks for Buying Hookmark, I hit ok, but then I try to run the Screenshot Shortcut and it tells me Shortcuts are only available to Pro users… tried quitting and restarting Hookmark, doesn't seem to help, and next time I launch it it tells me my trial has expired. I don't work on this particular machine much, but it did have a recent copy of Hookmark on it, so I assume I had it registered in the past. Any tips?
    >
    > Thanks,
    > Brett

  5. Support Staff 5 Posted by Brett on 28 Mar, 2023 01:56 PM

    Brett's Avatar

    Nope, I take it back, it keeps reverting to unregistered or telling me that my Updates license is too old.

    On 28 Mar 2023, at 9:53, Brett Terpstra wrote:

    > Never mind, I think I got it. Was clicking an older Updates License link I had, clicking the newer one and then restarting Hook seems to have registered it.
    >
    > On 28 Mar 2023, at 9:49, Brett Terpstra wrote:
    >
    >> Hey Luc,
    >>
    >> Putting a little morning coding time into that Hookmark/Marked issue on my vacation here, but for some reason my Hookmark license isn't working. I open it in basic mode and then click the link I have, it says Thanks for Buying Hookmark, I hit ok, but then I try to run the Screenshot Shortcut and it tells me Shortcuts are only available to Pro users… tried quitting and restarting Hookmark, doesn't seem to help, and next time I launch it it tells me my trial has expired. I don't work on this particular machine much, but it did have a recent copy of Hookmark on it, so I assume I had it registered in the past. Any tips?
    >>
    >> Thanks,
    >> Brett

  6. Support Staff 6 Posted by Brett on 04 Apr, 2023 03:32 PM

    Brett's Avatar

    Ok, I think I have this solved for the next update, appears you were correct about needing to update the scripting call from "Hook" to "Hookmark." Will get you a build to test and confirm this week.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac