Taitava / obsidian-shellcommands

Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
365 stars 12 forks source link

Request: Take StdOut from the executed command and insert at cursor #48

Closed Troberg closed 3 years ago

Troberg commented 3 years ago

It would be very useful if one could launch an external program, and take the output from that program and enter it into the current note at the cursor.

Example: Write a phone number, select it, call the external program which looks up the phone number in a database, sends back formatted name, address, phone and so on on StdOut, which then replace the selected text.

It would also be great for writing "generators", where you use a GUI to enter information, do some stuff with that information, and then inserts it neatly formatted into the note.

Taitava commented 3 years ago

Thanks for the suggestion! There's actually a conversation for this in Discussions: #16 . That contains also many other ideas for how to use the output (stdout).

Taitava commented 3 years ago

Implemented & released in 0.5.0.

More details in #34 .

FelipeRearden commented 3 years ago

Absolutely fantastic @Taitava !!!!!

Worked in my tests beautifully :)

Troberg commented 3 years ago

Finally back home and able to test. Works beautifully, thanks!

One more request on this one, and to be honest, I don't know if it's doable, and it's not very important, but still useful: It would be nice if StdOut is added to the document on the fly, not waiting until the shelled program exits. That would allow programs which can remain open and insert text as needed, for example a "text soundboard" (a program which inserts standard texts at the push of a button), or when triggered by external events.

Taitava commented 3 years ago

Thanks!

It would be nice if StdOut is added to the document on the fly, not waiting until the shelled program exits.

I created a new Idea discussion #64 for this.