Hi Souk! Sorry for bothering again but I want to share a sample scenario where It'll help if the input box writes to (for example) *$:/temp/command-palette-input* instead of a variable available only within CP (like how sidebar search manipulates *$:/temp/search*).
When it's a tiddler that's being manipulated, we can do a *<$list>* conditional on whether the tiddler is empty or not. In my case I can use it to trigger a style on the input box that'll hide the hint when the input is long (right now the hint isn't acting like a placeholder that disappears, although this can be solved via CSS with a *:*focus selector) Another is, we can make a PageTemplate that'll only appear on another *<$list>* conditional. Sample: Typing a certain key within the custom action, I can emulate a CP-style submenu that'll allow me to configure some things in context of my original actionString... Of course, this is only for while there's no built-in feature like that yet hehe! But you've shared something already great, writing to a temp tiddler is something I can live without! There are just some thoughts! Thanks again ^^, -jd On Sunday, August 2, 2020 at 9:47:43 PM UTC+9, Souk21 wrote: > > New version 0.0.6 ! <https://github.com/Souk21/TW-commandpalette> > Changelog: > > - [BREAKING CHANGE] Renamed field 'cp-hint' to 'command-palette-hint' > for consistency > - New shortcut commands for customization. Allow to call an action > string from the command palette with any prefix of your choice. Choose a > 'trigger' prefix that will override any other commands (even builtins like > + or @). The input (minus the prefix) is then set as a variable > <<command-palette-user-input>> for optional use in your action string (see > example at the bottom) > - actionString commands can now ask for user input. Set > 'command-palette-user-input' field to 'true'. The input is then set as a > variable <<command-palette-user-input>> for use in your action string. > (see > example at the bottom) > > > @Diego Mesa: While I would like to do a rewrite and there are still some > features I'd like to add, nobody complained about losing data yet. > Another point that might change is the name, as some people think it's > misleading in relation to TW's color palettes > So I would say it should be safe to use, but is probably gonna evolve a > bit before reaching 1.0 :) > About core/plugins, I've never looked into the process, so I'm not sure. > Thank you ! > > > @TW Tones: Thanks for the kind words! > EditorMagic looks like a really nice addition! > If I understand correctly, it would be some kind of autocompletion engine? > It would indeed be nice for CP to be able to interact with it. > It should be fairly easy when the data is available. > > > @JD: Thanks a lot :) > > how do I access the text of the CommandPalette input box and have it >> available to an actionString - type custom command? >> > It was not possible before, thanks to you, it now is :) > You only have to add the field 'command-palette-user-input' to any > actionString command and set it to true > The command palette will ask for user input before invoking the > actionString (with your hint if it's set) > You can then access the input value with <<command-palette-input>> inside > of your macro > > I tried looking at recently-modified tiddlers to see which one >> CommandPalette modifies, but there's none! >> > Woops. I'm a bit ashamed, but for now CP does not use state tiddlers. > Instead the state is stored in the DOM. I know it's not really in line with > TW philosophy, but it's way easier for me to develop it like that. I'll > definitely try to do it at some point. > > command-palette-hint contains the text of the hint informing the user of >> what the command does (for example) >> > I reworked the hint system and it is now available to every command (where > it makes sense) > > command-palette-popup-key can contain a key which, when inputted, will >> reveal the submenu, in context of the current custom command >> > 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 >> > That's something I'd like to do in a next version, I'm still not sure > exactly how, but I'll think about it ! > > BTW, you can also create tiddlers with tags : '+title @tag @tag2' > > Let me know if those changes work for you! > Thanks for the support :) > > > @Saq Imtiaz Thanks a lot! I didn't know. That probably saved me quite a > lot of time, and the solution is more elegant :) It's really nice of you, > thanks again! > > > > EXAMPLES: > Shortcut: > command-palette-type: shortcut > command-palette-trigger: = > command-palette-hint: New Tiddler with name > tags: $:/tags/CommandPaletteCommand > title: $:/New Tiddler > type: text/vnd.tiddlywiki > > <$action-sendmessage $message="tm-new-tiddler" title=<<command-palette- > input>>/> > > > > > actionString with user input: > command-palette-type: actionString > command-palette-name: New Tiddler with name > command-palette-hint: Enter the name > command-palette-user-input: true > tags: $:/tags/CommandPaletteCommand > title: $:/New Tiddler > type: text/vnd.tiddlywiki > > <$action-sendmessage $message="tm-new-tiddler" title=<<command-palette- > input>>/> > > > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/bc3f9d57-5772-4437-aa82-f64872394bd0o%40googlegroups.com.