Can you just use the mkdir
command before running pandoc
?
I had tried that, but, I was missing the -p
after mkdir
to create a new directory (whatās the point of mkdir
if not to do that??).
Now it works. Perfect, thank you so much!!
Hi @sbell,
sorry for the trouble, there seems to be a bug in SC. When the shell is CMD, separating commands with newlines seems to cause CMD not to execute the commands. (Edit 2022-12-23: Actually, the first line seems to execute, but not any further line). Even worse, CMD doesnāt even give any error message, like you noticed.
I created a GitHub issue for this and will do some research on how to fix this. I need to find out in which format newlines should be presented to CMD.
In the mean time, you can put the commands on a single line like this:
echo [Startup] >%temp%\fhini.ini & echo Window=FocusWin >>%temp%\fhini.ini & echo Record=I92 >>%temp%\fhini.ini & start "Run FH" "C:\Program Files (x86)\Family Historian\program\fh.exe" "/ini:%temp%\fhini.ini" "C:\Users\sarah\OneDrive\Genealogy\Family Historian Projects\2022 Family Tree\2022 Family Tree.fh_data\2022 Family Tree.ged"
Or you can switch your shell to PowerShell 5 or PowerShell Core, but that would require you to change the start
command and the %temp%
variable. I donāt remember their PowerShell equivalents now.
{{new_note_folder_name}} gives you the Obsidian setting used to denote in which folder Obsidian should create new note files.
Good that you got it working already! Iāll still write a shell commadnd here in case anyone else needs to do a similar thing:
mkdir -p "/home/Obsidian/Output/"{{title}}
pandoc {{file_path:absolute}} -o "/home/Obsidian/Output/"{{title}}/{{title}}.tex
(I didnāt test this myself as I donāt have pandoc installed, but if I understood correctly, this might do the thing that was asked).
Oh, yes sorry, I was going to add that complete command now that Iām done. Thanks for this. This is an awesome plugin!!
Thank you for your kind feedback!
Thanks so much for your help. Hopefully there is a solution for multi-line commands found soon! Your one-line solution works for me
Youāre welcome. Too bad, I guess the CMD newline problem wonāt be solved anytime soon, if ever. I wrote a question in Stack Overflow, but havenāt got any actual answers yet.
Issue, or lack of understanding: File Menu event appears with blank Alias
Hi. I am using Obs. 1.1.9 on a Mac Pro under MacOS Ventura.
I have one shell command registered and it functions correctly, however where the alias should appear in the file context menu is a blank item:
What am I missing?
A screen shot of the settings summary:
Command is:
open -a Atom {{event_file_path:absolute}}
(Obsidian) SYSTEM INFO:
Obsidian version: v1.1.9
Installer version: v1.1.8
Operating system: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64 22.1.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 3
Plugins enabled: 1
1: Shell commands v0.17.0
Hi . I replied to you in GitHub, but will reply shortly here, too.
~~The bug is confirmed. A fix will be released in 0.18.0
. More information for a workaround until the fix is released: File Menu event appears with blank Alias? Ā· Discussion #313 Ā· Taitava/obsidian-shellcommands Ā· GitHub
Edit: Actually I was not able to reproduce. Will continue researching this.
Discussion continued on the Github issue page.
Thanks! This saved me a ton of time; I thought I was going to have to write my own plugin!
My case is super simple; path of file saved >> shell script >> venv + python websocket >> one line of json to my code in the Godot engine (the ws server). Basically the plugin tells a renderer in Godot to re-scan a file that just changed. But the possibilities this opens up are fantastic, and it took just minutes to get working.
Now⦠if you added a native websocket client notifierā¦
Ability to define custom shells
Beta test: 0.19.0-beta.1
Itās possible to define custom shells to have flexible control over how your shell commands are executed. You can e.g. define Windows Subsystem for Linux as a shell.
Custom shells are not yet published in a normal release, so if you want try them out, youāll need to install the beta version - see instructions in the GitHub discussion linked above.
More information about custom shells can be found in SC documentation.
Older, notable changes between 0.17.0
and 0.18.2
(= the latest non-beta version)
Feature (GitHub issue) | Documentation |
---|---|
Ability to pass variable values to stdin (#283) | Documentation |
New variables: {{yaml_content}} and {{event_yaml_content}} (#267) | Documentation |
Thank you for a great plugin.
Iām looking for a variable and not sure it exists. I want to refer to the __{a}__
value when I embed the command [__{a}__](obsidian://shell-commands/?vault=NCeph&execute=ikafv58xqy&_num=__{a}__)
Specifically I use this as
[2505551234](obsidian://shell-commands/?vault=NCeph&execute=ikafv58xqy&_num=2505551234)
⦠I would like to key in the [ ]
part and have that passed to the _num
variable at the end.
Does this variable exist? Can it? What is it? (fingers crossed).
The command works, except I have to type the phone number in twice. (I use this to call CallClerk ⦠a phone / call manager.)
Thank you
Hi! Thanks for the feedback and question .
If I understood correctly, youād like to be able to pass the label text of a link to a shell command. Unfortunately thereās no variable for that. I agree that it would be handy. Iām afraid it might be that thereās no way to create that kind of variable. ObsidianProtocolData (which is used for the URI that executes shell commands) doesnāt provide the clicked linkās label, and I guess itās because when an obsidian://
protocol request is done, thereās probably no link label information available if Iām not mistaken.
For being able to get the label text, the SC plugin should listen for all link clicks (and I donāt know how to use Obsidian API to do that if thatās even possible). If thereās anyone out there who can provide tips for me, I would be grateful.
Hi all, first of all: thatās an amazing plugin. Thanks a lot.
Now my question/idea: Iād try to run some lint tool against the currently open note. Let say proselint
but it apply to any cli tool getting the note filename as input and write on stdout/stderr some messages about error in my note test.
My proble is: What to do with the output?
Open it in a baloon works for me but it is not ideal as I like ot use the text messages to fix my note.
I can instruct the plugin to write the errors at the end of the note itself and keep deleting them one ny one as soon as I fix the text issues.
Any other idea?
Hi Jare,
Iām really enjoying the plugin! However, since my script is quite long and I have several existing commands, itās becoming easy to mix them up. I believe the interface could be improved by allowing users to edit only the selected command on the page, rather than making all commands editable in the same window. Ideally, I would like to save my shell scripts securely as bash files. While I was able to call my external scripts using source $Script_Path &
, I noticed this does not assist in recognizing Shell Command variables like {{title}}. What do you recommend?