Replies: 7 comments 12 replies
-
I think another way to implement would be to make this a preaction instead of a variable, mainly for two reasons:
I have not yet created a discussion for preactions, but will do it sometime. |
Beta Was this translation helpful? Give feedback.
-
The content of this post was moved to another discussion in here #74 ! |
Beta Was this translation helpful? Give feedback.
-
Hello @Taitava !!!! Let's see if this time I have a user case for {{input}} :) User Case - Append text from Active Note to one Note from a List of Notes01 I have a note that is an inbox of all my twitter bookmarks:
02 When I'm reading in this note, I want to transfer some content for a note related to the tweet. 03 Example I have a tweet from Ryan Holiday that is a quote from Marcus Aurelius that I want to send to the note [[Marcus Aurelius]] I have a SC to do this: The same spots described above is applied to 5 notes for example:
My idea is to use the {{input}} to select the destination folder of each tweet:
Options for {{input}}
Is this the right example of {{input}} ? |
Beta Was this translation helpful? Give feedback.
-
I would love this feature for being able to change the last-modified date for a note without leaving Obsidian. I think I'd be able to use this to run a command like |
Beta Was this translation helpful? Give feedback.
-
I renamed the discussionOld title: An {{input}} variable for asking a value from user |
Beta Was this translation helpful? Give feedback.
-
I don't understand the description of the Folder selector with the limits but I would like to be able to make a prompt that can select any folder on the system and send that path to the script or command.💪🏻 |
Beta Was this translation helpful? Give feedback.
-
New field types are now released in
|
Beta Was this translation helpful? Give feedback.
-
Like I mentioned in a comment in issue #14, I have been thinking about a new variable named
{{input}}. When a command is executed, if the variable is present in the command, the plugin could open an small popup window and ask the user to type something, that will then be the value of{{input}}.I was originally thinking only about a typeable freeform value, but @FelipeRearden mentioned that
{{input}}could also have a list of options that the user can select from. Really good, as sometimes you do need to limit the possibilities so that it's easy for the user to decide what to input. So I started to think that there needs to be a way to express what kind of form element the user is offered.Added 2022-02-07: No {{input}} variable, but custom variables instead
This post talks a lot about a variable named
{{input}}
. I've decided not to implement that variable. The inputted values will be stored to custom variables, whose names can be decided by a user. This way the inputted values will have more meaningful variables names in the shell command definitions. E.g. if you ask for a due date, you can name the variable to e.g.{{_due_date}}
, and then a shell command's source codeecho "The due date is:" {{_due_date}}
tells clearly that the variable contains a date.echo "The due date is:" {{input}}
would not be that descriptive.Input types
How well do linebreak characters work in shell commands? That I'll have to see. In some cases they might end one command and start a new one, unless they are inside quotes). * Edit 2022-05-12: Linebreaks will work just fine, the current method to escape special characters - including linebreaks - handles this well.*) Would not be implemented in the first version of
{{input}}.Definitions
I'd like the input elements to have certain properties:
singleline
/multiline
/list
/toggle
.The following is just a draft example of the definition format, but I'd just like to give you a clue what it might look like. It will probably change.{{input:singleline:Description text goes here:This is the default value}}
Multiple
{{input}}'s in one commandIf a command has multiple
{{input}}variables in it, all of them will be displayed in the same modal (= popup window). No need to open a new modal one after each other. It's easier for the user to see all the inputs at once, and if they have filled one field, then switch to another, they might change their mind regarding the first field, and it's easy to go back to edit values they already filled.For example:
cd {{input:singleline:Give a directory for the new file}} && touch {{input:singleline:Give a name for the new file}}
Edit 2022-03-24: An updated example:
cd {{_directory_name}} && touch {{_new_file_name}}
Prompts will be defined separately in the settings, so the questions will not need to be declared in the {{variables}}. Custom variables will be used to pass the values, which means that the names
{{_directory_name}}
and{{_new_file_name}}
are freely decideable.Ability to refer to the already asked
{{input}}a second timeFor example:mkdir {{directory=input:singleline:Give a directory for the new file}} cd {{custom:directory}} && touch {{input:singleline:Give a name for the new file}}
Here{{directory=input...
would define a custom variable for us and store the result of {{input}} there so that we can use the same value twice without asking the user twice.{{custom:directory}}
would refer to thedirectory
variable we just created. I could also consider accessing custom variables without thecustom:
prefix, simply like{{my_custom_variable}}
, but I fear that there might be overlapping with variable names if I introduce new variables for this plugin in the future. Let's go with{{custom:my_variable_name}}
first and decide later if the shorter format is needed.But talking about first... this ability to use custom variables would be separate feature issue, and it would be implemented later than the first version of {{input}}.Edit 2022-03-24: The plan in this chapter is outdated. But anyway, there will be a way to use an inputted value multiple times in a shell command. Just use a custom variable multiple times, e.g.
touch {{_new_file_name}} && gedit {{_new_file_name}}
.Beta Was this translation helpful? Give feedback.
All reactions