Can you launch Markpad directly to the editor?
Many thanks for a very useful tool.
Is it possible to launch Markpad directly to the editor?
For example: markpad.exe --edit filename.md
If filename.md doesn't exist, then it would be nice if Markpad didn't report an error - but instead allow me to type some content and then create the file when I exit. If there is nothing to save, then the file isn't created.
Platform and Markpad version
Windows 11. Markpad version 2.8.4
Thanks! Opening straight into the editor already works. It's a setting rather than a flag: go to Settings → "Open existing files in" and choose Editor. After that, markpad.exe filename.md opens the file in the editor. Markpad ignores flags like --edit, so you can leave it out.
For a file that doesn't exist yet, Markpad shows an error today. What works now: open Markpad, press Ctrl+N for a new file, type, and save it under the name you want. If you close it without saving, no file is created.
I'll close this, but reply if that doesn't cover what you need.
Hi, thanks for the quick reply.
Unfortunately it doesn't really cover my use-case, which is that I use the reading mode of Markpad for about 95% of the time but I sometimes want to open a markdown file from a third-party app for editing. I could just use Markpad for reading and configure the third-party apps to use VSCode for writing - but since I already have Markpad open, it seems a bit silly not to.
With my proposed approach, I could configure the third-party app to call say markpad.exe --edit <filename> but continue to keep the default action of reading whenever it is opened elsewhere (e.g. double-clicking on an .md file).
If this is a niche use-case, then I completely understand. My only alternative would be to create a wrapper that temporarily changes Markpad's default mode to editor, launches it, and then restores the reader setting. However that does feel slightly complicated and a little bit fragile.
we will consider it
Thank you.
Just to let you know, I created a small helper app which does what I want, but ran into some problems:
- There is no registry key, environment variable or config file to open a file in Editor mode so I couldn't temporarily change it, launch Markpad and then revert back.
- My workaround was to launch Markpad, bring its window to the front and send Ctrl+E - but it often didn't register. It depends on a fixed delay for the file to finish loading (I added a bit longer for a cold start), on the window having keyboard focus and on the file not already being open in a tab. I never found a delay that worked every time.
- The window title is always "Markpad". It doesn't include the file name, so I couldn't tell which window belonged to my file when several were open and had to use the first one I found.
- If I try to open an empty file, Markpad just showed the welcome screen and so Ctrl+E wouldn't work.
In the end, I've gone with a helper that launches VSCode for editing and Markpad for reading, as it's a much nicer reader.