nelsonic/amemo

Mac Markdown Editor

Opened this issue · 3 comments

Tried:

open -a "Mardown Editor"

Got:

Unable to find application named 'Mardown Editor'

Followed: How to Run ANY APP Using Terminal on MacOS: https://youtu.be/BYKpot_NjH8

image

image

image

But what I want is a keyboard shortcut or alias I can run to open the app with a specific file ...

https://wpbeaches.com/make-an-alias-in-bash-or-zsh-shell-in-macos-with-terminal 👀

vi .zshrc

Add the following line:

alias m='/Applications/Markdown\ Editor.app/Contents/MacOS/Markdown\ Editor'

Save the file: Esc, wq, Enter

Run:

source ~/.zshrc

Then:

cd ~/code/book
m

That worked to open a blank editor:

image

But what I want is to open a document in the editor ...
e.g:

m README.md

Sadly, I get the following error:

Error Domain=NSCocoaErrorDomain Code=260 "The file “README.md” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/n/Library/Containers/info.iwaki.MarkdownEditor/Data/README.md, NSUnderlyingError=0x6000035dc3f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

https://apple.stackexchange.com/questions/212583/how-to-open-files-via-terminal 👀

Let's try:

vi .zshrc

Add the following line:

alias m='open -a "/Applications/Markdown\ Editor.app/Contents/MacOS/Markdown\ Editor" README.md'

Save the file: Esc, wq, Enter

Run:

source ~/.zshrc

Sadly, that hunch didn't work either ...

The application /Applications/Markdown\ Editor.app/Contents/MacOS/Markdown\ Editor cannot be opened for an unexpected reason, error=Error Domain=NSCocoaErrorDomain Code=260 "The file “Markdown\ Editor” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Applications/Markdown%5C%20Editor.app/Contents/MacOS/Markdown%5C%20Editor, NSFilePath=/Applications/Markdown\ Editor.app/Contents/MacOS/Markdown\ Editor, NSUnderlyingError=0x60000209c270 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Next Attempt:

vi ~/.zshrc

Add line: (replace the line that isn't working)

alias m="open -a /Applications/Markdown\ Editor.app"

Save the file and run:

source ~/.zshrc

Now in any directory that has a README.md file:

m README.md

Voilà!

image