hauselin/obsidian-alfred

Search (os, oss, or, orr...) does not seem to work

RoamanEmpire opened this issue ยท 14 comments

I have set up all the variables properly (hopefully) and every feature of the workflow works as expected, except for searching for md files.
If I type any of the search keywords, oss for example, press enter (figure 1) and then start typing, nothing seems to show up when I search for a file that I know exists (figure 2).
image

image

These are my settings (/Volume/Notes/ is the volume where I store various notes, /Volume/Notes/Notes is the folder where my Obsidian vault is stored). Both Alfred and Spotlight can find the md files I search for and every other feature of the workflow works perfectly.
image

That's odd. Does od work for you? Does it properly open your daily note in Obsidian?

If so, I might need some debugging/logging info. Could you try the following? Open Alfred, go to the workflow, click the bug icon at the top right to pull up the logging/debug pane at the bottom. Then invoke Alfred and run os 2020-12. Then show me the log data (see screenshot below). That might provide some clues...

image

Yes od works as expected, although it does not apply the date tags ({{date}}) I defined in the daily template.

os does not show anything in the debug window. As soon as I start typing a search query Alfred falls back to the default search view.

image

oss on the other hand shows this:
image

Yea, that's the expected behavior of od. It just makes a copy of your template, so it's not "inserting" the way Obsidian does it. Not sure if there's a way to address this problem.

As for your problems with os, could you let me know what's your Alfred version? Try the following solutions, one at a time, to see if it addresses your problems.

  1. Navigate to the "Basic Setup" pane and remove the highlighted line under "File Types". Removing this line will make os return all filetypes, not just markdown. If you want to restrict the output to only markdown files, drag and drop a markdown file from vault into this section. If after modifying this and os still doesn't list any matching files, try step 2.

image

  1. Click on the os's Script Filter, navigate to the Scope pane and checked "Show files marked as System File". Then save settings. And make sure your scope is empty (just like the screenshot below). See if that works? If not, move on to step 3 and let me know what happens...

image
image

  1. Try creating a temporary new vault in another directory (maybe your desktop) and then add it with oaddvault. Create a markdown note in it and see if os finds it. If this doesn't work, it might be an Alfred version issue...

Have you tried using on to create a new note in your vault? It also uses Script Filter, so if you also cannot get on to work, then it's even more likely it's an Alfred version/Script Filter issue.

It seems to work now after step 2. Thank you! I removed that file type from os, or, and ot and now all commands work properly.

on worked fine both before and after step 2.

Great!

As another point of reference, I had the same issue, and it also was resolved after performing step 2.

Thanks for letting me know, @HEmile. I'll probably add a note to the README later.

To add a slightly different point of reference, what fixed it for me was to remove all the file types like in step 1), and then to drag and drop one of the markdown files from my vault to the Alfred "File Type" list. Turns out Markdown files are marked as "com.unknown.md" on my system.

To add a slightly different point of reference, what fixed it for me was to remove all the file types like in step 1), and then to drag and drop one of the markdown files from my vault to the Alfred "File Type" list. Turns out Markdown files are marked as "com.unknown.md" on my system.

Man, I've been banging my head trying to figure this out. I have no experience with code, programing or an of the things mentioned here, or the other issues referring to my problem.

I did the steps you provided and all of a sudden the os command now recognizes everything and works. Mine seems to be dot com type as well.

I will further test all the other functions now that this is working and if they don't work, I will check the status in the related problem for the same issue.

Thanks so much for posting this. @etiennepellegrini

Dan

P.S. I will also post this in the thread that I created with the developer. Not sure if that is needed?

To add a slightly different point of reference, what fixed it for me was to remove all the file types like in step 1), and then to drag and drop one of the markdown files from my vault to the Alfred "File Type" list. Turns out Markdown files are marked as "com.unknown.md" on my system.

Man, I've been banging my head trying to figure this out. I have no experience with code, programing or an of the things mentioned here, or the other issues referring to my problem.

I did the steps you provided and all of a sudden the os command now recognizes everything and works. Mine seems to be dot com type as well.

I will further test all the other functions now that this is working and if they don't work, I will check the status in the related problem for the same issue.

Thanks so much for posting this. @etiennepellegrini

Dan

P.S. I will also post this in the thread that I created with the developer. Not sure if that is needed?

@Harvison, glad you've found the solution!

Just to say that I had the same issue, skipped to step 2, which didn't solve the issue, then performed step 1, and that solved the issue. Thanks so much!

I had the same issue, and applied both steps 1 & 2 above; neither solved the issue.

Only when I removed the preconfigured entries for "obsidian help" ("vault1" and "vault1name") in the "Workflow Environment Variables" section did the search finally work.

Obsidian: 0.12.15
Alfred + PowerPack: 4.5.1
obsidian-alfred: 0.3.7

  • Guy

Posting in case others have a similar issue. I was seeing the same symptoms, but the root cause for mine was an outdated macOS spotlight index. (Even Alfred's native file search wasn't finding the files)

I rebuilt the spotlight cache, ran reload in Alfred and et voilร โ€”the workflow started working!

I have tried all the steps a few times. None of them worked for me, and I cannot use on either. I am on the latest version of Alfred Alfred 5.0.5. Should I downgrade to an earlier version so see if that works then?