API to open a file and populate a search?

Rainer's Avatar

Rainer

30 May, 2016 10:02 AM

I would like to open a markdown file with a search term already pre-populated.

I looked at the URL handler documentation and couldn't find a query parameter that would allow me to specify a search term.

I also looked at the script dictionary for Marked2 and couldn't find anything (but I have to admit that I am not too familiar with the script dictionaries, so I might have missed it).

So is there a way to achieve this? Did I miss something obvious?

Thanks, Rainer

  1. Support Staff 1 Posted by Brett on 31 May, 2016 06:59 AM

    Brett's Avatar

    This isn't a feature exposed in the API. I actually don't know of many
    apps that have such a feature, so I'd be curious about your use case.

    -Brett

  2. 2 Posted by Rainer on 31 May, 2016 07:08 AM

    Rainer's Avatar

    My use-case: I have directories with notes (as Markdown files). I want to automate following: do a spotlight search in these Markdown files to find the files that match my search term; then I want to be able to choose a file from the list to open it in Marked 2. And I want to use the spotlight search in Marked 2 automatically, so that I can easily see the location where the file matches (or jump to the matched place).

  3. Support Staff 3 Posted by Brett on 01 Jun, 2016 01:58 PM

    Brett's Avatar

    That's reasonable, and adding an API method to handle this would be relatively simple on my end, so I'll consider it for an upcoming update.

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