@souk21 @jd suggest that CP make the original string from the input available as a variable to the actions invoked by commands. The last optional argument to invokeActionString is a hashmap of variables that will be available in the actionstring.
On Tuesday, July 28, 2020 at 2:13:51 PM UTC+2, JD wrote: > > Hi Souk21, > > I am in love with this! This is truly amazing and exactly what I need in > my personal wiki! > > I have a question (searching for the answer of which put me into creation > mode), how do I access the text of the CommandPalette input box and have > it available to an actionString - type custom command? > > I wish to integrate my NTFS22 macros into this elegantly (it works by > parsing the content of a tiddler, i.e. the tiddler modified by the > searchbar). I tried looking at recently-modified tiddlers to see which one > CommandPalette modifies, but there's none! > > So, for now I am using a custom command that calls up an identical-looking > input box into the screen. I feel like this is a hack because it's not > actually using Command Palette's input box like how I wish it will be able > to! Am I just missing something? hehe. > > Also another idea: how about, inside a custom command tiddler, let there > be three additional fields? > > > - *command-palette-popup-key* can contain a key which, when inputted, > will reveal the submenu, in context of the current custom command > > > - *command-palette-popup* contains the title of the tiddler for the > body of the submenu > > > - *command-palette-hint* contains the text of the hint informing the > user of what the command does (for example) > > *Sample use:* > > 1. I have a custom actionString command. This will run a macro on the > text string of the input box on "ENTER" > 2. For preferences on how the text string will be parsed, I wish to > access a *preferences* page... So maybe by inputting "|" the submenu > will open and allow me to configure things > > Anyway, because I don't know how to create those things natively into the > current version of Command Palette, I forked a version of my NTFS22 plugin > and it does the above things. > > Please take a look here > <http://j.d.ntfs22.tiddlyspot.com/#Integration%20with%20Souk21%27s%20commandpalette%20%2F%20NTFS22%20anywhere> > to > see what I'm trying to accomplish. My plan is to retire this plugin once I > can do the same things with Command Palette! > > Thanks again for this, and I'm looking forward to creating more permissive > custom commands! > > - jd > > > > On Thursday, June 11, 2020 at 2:31:24 AM UTC+9, Souk21 wrote: >> >> Hello everyone! >> >> >> I discovered TiddlyWiki a couple weeks ago, and I set myself to use it >> for note taking. >> I really enjoy the trip so far, it really is a interesting piece of >> software. >> The only thing missing for me is a proper way to search with the keyboard >> only. >> >> There’s a shortcut to focus the search field, but unfortunately, you >> can’t navigate the results with the arrows, and you can’t close the >> dropdown with escape. >> >> >> I looked around for a plugin, but I wasn’t able to find any that worked >> for me. >> So, in a tiddlywiki mindset, I decided to try and make my own. >> I took a lot of inspiration from VSCode command palette. >> By default you open it with Ctrl+P, but you can change the shortcut from >> the tw settings >> You can search tiddlers by text or with a filter expression, search tags, >> list all tiddlers with a tag,... >> If you type ‘>’ you enter the ‘command’ mode and you can select (or >> search) from a list of commands. >> You can access help if you type '?' >> >> >> I tried to make it the more customizable I could, there’s still work but >> it’s already quite customizable. Most of the commands are only tiddlers! >> It’s a prototype, and my first tw plugin as well, so obviously the code >> is a mess! It could have unexpected behavior (most probably does) and you >> shouldn’t use it in your own wikis yet! >> >> >> I tried my best, but for now, the plugin is not really working as tw >> expects plugins to. >> The plugin always returns ‘refresh=false’ and manages his own DOM itself, >> storing state inside of it in the way. >> I was not sure where to ‘instantiate’ the view, so for now I’m using >> $:/View/AboveStory which I believe is not ideal. >> So yeah, really not the tw way. >> >> >> There are still some other problems, I’m not sure how to escape a filter >> operation parameter for example so the search sometimes returns errors >> >> Obviously it’s not really optimized yet either. >> >> I do plan to fix it and include more features (I still have a tiddler >> full of ideas) >> >> >> I’m posting here to see what people think of this prototype and if >> there’s any interest in such a plugin. >> >> If so, I’m probably gonna need some guidance into how things are supposed >> to work so I can make it work more nicely with tw. >> >> Considering the state of the project, I didn’t take the time to write any >> doc yet. >> >> You can demo it here : https://souk21.github.io/TW-commandpalette/ >> >> Let me know :) >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/080d0d81-1c7e-4ae3-aabc-75fbc07ad620o%40googlegroups.com.

