Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Markdown Editor #60

Open
nelsonic opened this issue Feb 5, 2023 · 3 comments
Open

Mac Markdown Editor #60

nelsonic opened this issue Feb 5, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@nelsonic
Copy link
Owner

nelsonic commented Feb 5, 2023

https://apps.apple.com/us/app/markdown-editor/id1458220908?mt=12
image

"productivity" indeed ...

@nelsonic nelsonic added the enhancement New feature or request label Feb 5, 2023
@nelsonic
Copy link
Owner Author

nelsonic commented Feb 5, 2023

@nelsonic
Copy link
Owner Author

nelsonic commented Feb 5, 2023

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"}}

@nelsonic
Copy link
Owner Author

nelsonic commented Feb 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant