KevinBatdorf / obsidian-raycast

Raycast extension with commands for the note taking app Obsidian.
MIT License
106 stars 19 forks source link

Fallback Action #23

Closed cyrulnik closed 2 years ago

cyrulnik commented 2 years ago

Thanks for this plugin. Just started using it -- and apologies if I'm missing something obvious. But is there a way to configure Obsidian note search to work as a fallback command in Raycast so that it would be available (along with Google search, etc.) to use on any text that is typed directly into the search bar?

marcjulianschwarz commented 2 years ago

I don't know whether I understand your issue correctly but here are a few clarifications and one suggestion:

"Obsidian for Raycast" is an extension for Raycast that adds various commands like "Search Note", "Create Note", etc. You can use these commands from the Raycast search, just like you can use the Google search right from the Raycast search.

There is no way to override the default Raycast search.

You can however assign a keyboard shortcut to the Obsidian search:

Now you can open Obsidian search from anywhere just by pressing the keyboard shortcut.

cyrulnik commented 2 years ago

Sorry - should have been more clear. Raycast has two ways of doing a Google search (or a file search, etc.) One is that you bring up the Raycast search box, go to Google search, press "enter" and then start searching. The other is that you bring up the Raycast input box, type your search terms without first triggering a google search, and the select google search after the fact. Raycast calls these fallback commands -- as discussed in the linked document.

https://manual.raycast.com/fallback-commands

If you trigger the Raycast input window and start typing a google search

marcjulianschwarz commented 2 years ago

Thank you for the clarifications.

I don't think that it is currently possible for third-party extensions to configure fallback commands. I haven't found anything in the API documentation and there are no third-party extensions supporting fallback. At least I couldn't find any.

However I really like the idea of these fallback commands. Maybe you can open a feature request at raycast or contact them about it.

marcjulianschwarz commented 2 years ago

Hey @cyrulnik,

this might not be exactly what you want but Raycast just announced Arguments for Commands. I will add this to the extension. However as far as I can tell these still dont work as fallback commands. I think this might come soon.

marcjulianschwarz commented 2 years ago

Looks like this:

https://user-images.githubusercontent.com/67844154/180615837-4ae97c57-9b8b-4dd3-8861-6dd707193a85.mov

marcjulianschwarz commented 2 years ago

You can add your own fallback commands with Quick Links.

This Quick Link will open Obsidian, open the vault "Second Brain" and search for the query (text you entered in the Raycast search) in Obsidian:

obsidian://search?vault=Second%20Brain&query={Query}

This Quick Link will open Obsidian, open the vault "Second Brain" and open the note:

obsidian://open?vault=Second%20Brain&file={Note}

Make sure to select Obsidian as application for Open With:

Bildschirmfoto 2022-08-23 um 21 24 13

Also make sure to go to Configure Fallback Commands and add the Quick Links there.

If you want to go even further, you can enable Quick Search (see further down) which allows you to trigger the Quick Links with your selected text.