-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #18 add an option for allowing to open an existing quick note when creating a new one #33
base: main
Are you sure you want to change the base?
Conversation
…uick note when creating a new one
Hi @RYSKZ merging this PR would be nice! I found Tray plugin very useful to autostart Obsidian minimized (using Linux), but considering that this PR is merged, I realized that there's no convenient enough way to insert a quick note without changing context. So I researched a little and come up with this solution to add a quick-notes to the daily note file. I wrote a small script that relies on https://github.com/coddingtonbear/obsidian-local-rest-api plugin, to insert quick notes from a terminal. I have aliased the script The script here: https://github.com/gerardbosch/dotfiles/blob/main/home/bin/obsidian-quick-note Result: This is the template I'm using to create my daily notes, which contains a "Quick notes" section/heading:
I hope this helps someone! |
Hi @gerardbosch, I have been thinking seriously about this since I added this new feature. Currently, I am also facing the problem of the inability to quickly create a new note to jot down information relevant to the task I'm working on without having to switch context and interrupt my workflow. Currently, I have to bring Obsidian to the foreground using the dedicated hotkey I have set up in Tray and then, within Obsidain, I use another hotkey associated with a Quick Add script to create a new quick note. I find it a bit tedious to have to go through this two-step process to do this each time, and manually toggling the setting I added in the options menu is far from convenient, so I've come up with a new solution. Here's what I'm proposing: within the Tray plugin, we should have two coexisting options. The first option would be to create a daily note, but it wouldn't allow duplicate entries, if the hotkey is pressed and the note exists it will open it up instead. The second option would be to create a quick note with a predefined template name, and it would allow for duplicates by inserting an auto-incremental numeric suffix. Each of these options would have its own dedicated hotkeys, and you could also specify a different destination folder for where these new notes will be saved. Both of these can be configured in the plugin settings panel. In a nutshell, here's what I'm suggesting:
With this new approach, I believe we can eliminate the need for the toggle I added in the settings, as I don't think anyone will require it, as what I am proposing now is much more flexible. Let me know what you think. As for your solution, thanks for sharing it! It is very practical, and I will use it while I find time to work on this new proposal. I prefer to write directly in Obsidian, as it allows me to take advantage of other plugins and handy features that are built into Obsidian and I think that for long-form writing directly in Obsidian will be a better experience than using the terminal, so I will try to implement this new version of the feature, and I will update this PR when it is finished. |
Sounds good! allowing to run any Obsidian command from Tray plugin via global hotkeys could be cool! I think there's already an issue for this here #23 My quick script is more intended to quickly insert ideas, short notes or reminders in a couple of keystrokes :) and to organize or further elaborate it later inside the Obsidian interface. For example taking a quick note or reminder during a meeting without much worry 🙂 |
Sorry for the delay in responding, these months have been incredibly hectic :( You read my mind! I was going to suggest this too. I did some research and, at first, couldn't find a way to get the commands available in the documentation. However, I found that the Advanced URI plugin can list all the available commands and looking at the source code it looks like there is an attribute that can be accessed to get this list ( However, after thinking about how to implement it in Tray, I came to the conclusion that it is better to develop and use a separate plugin for this, as integrating it in Tray will make the user interface of the plugin more complex. I'm unsure whether Obsidian supports the level of dynamism required within the settings panel of the plugin or if this mapping should be handled through the command palette (which, in my opinion, would feel a bit weird to use). In the case of using text entries to specify the command names or ids. to map, instead of a list or menu with the options already filled in, will result in a strange UX. Fortunately, there is already a plugin that allows you to assign any available command to arbitrary global hotkeys that are active system-wide (i.e., no matter if Obsidian is minimized, in the tray or in the foreground, they will still work): I recommend to use my fork instead, because I made changes to make it compatible with Tray (disable the unregistering of global hotkeys assigned by other plugins, such as Tray): I could not find this plugin in the Obsidian third-party plugin repository, so, if you decide to use it (or my fork), you should carefully review the code, and then you need to install it manually or through Obsidian BRAT (using the I think using this plugin alongside Tray is the simplest solution to achieve this functionality, addressing also #23. Alternatively, another option is to use this other plugin that allows you to call any command by a URI (even ones that don't expose any, as the other plugin referenced earlier), which you can then use to integrate it into other applications or assign it to any hotkey using AutoHotKey or similar software: |
I'll push the changes I've made to the pull request since my previous commit, including the latest modifications outlined in my previous comment, in case anyone find them as useful as they have been to me. Specifically, these changes allow for the configuration of separate directories and note filename formats for quick notes and daily notes, with the added capability to set independent hotkeys for each. In addition, I have retained the option to toggle the duplication of daily notes when the hotkey is activated several times in the same day, in case it is beneficial to somebody. |
…tories and note filename formats for quick notes and daily notes, with independent hotkey settings
The functionality for adding quick notes is now customizable through a new toggle integrated into the plugin's settings tab. Users can activate this new option to allow opening an existing quick note when creating a new one. On the contrary, disabling it reverts to the current behavior: if a daily note with the same name exists, new quick notes will adopt the same name, followed by a unique auto-incremented integer and, if no daily note with that name exists, a new quick note will be created with the data format chosen by the user.
By default, I have chosen to enable this feature, as I believe it is the preference of most users, but I recognize that it can be somewhat subjective.
This feature addresses issue #18.