phibr0 / obsidian-open-with Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
On macOS, the initial /
is missing when copying the absolute path to the clipboard
If I'm trying to launch /Applications/MacVim.app/Contents/MacOS/MacVim
, what gets invoked is:
open -a "/Applications/MacVim.app/Contents/MacOS/MacVim" "/Users/huyz/Documents/Vaults/Vault/Obsidian playground.md" --args ""
The extra blank argument ""
makes an empty window be opened too.
So I guess this is a bug and blank arguments should not be passed at all.
I deleted the old command and added a new one, but it no longer works, nothing happens. Is there anything special that I have to do?
Does the flatpak version need special permissions to trigger the plugin action? It doesn't want to work, I tried to give explicit permissions already.
I try to use your plugin on macos. I didn't understand how to use it. What should I write in the commnad/path section to make it work?
Platform:
Ubuntu 21.10 LTS 64bit
Obsidian 0.12.19
The Obsidian application needs to launched with the working directory set to root '/' for this plugin to work correctly because it attempts to open external programs with a root relative path (i.e. no initial /). If you launch from your home directory it will attempt to open with with a root relative link and thus yield an invalid path e.g. /home/matt/home/matt/notes/interesting.md
Current workaround compatible with most DE: one can specify the working directory for the menu entry
➜ ~ more .local/share/applications/menulibre-notes.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=Notes
Comment=obsidian notes
Icon=applications-other
Exec=/home/matt/Dropbox/tools/Obsidian
Path=/
Actions=
Categories=Office;
StartupNotify=true
➜ ~
Is there a way to pass the current line number (or even better, selection) in the arguments of the command ?
Environment: macOS, Obsidian v0.12.12
Can't work well in macOS, I think it may be caused by a problem of getting file path. (Have Verified)
Clipboard result: Users/ludwigws/OneDrive/MyNote/202109010915.md
getAbsolutePathOfFile(file) {
//@ts-ignore
const path = obsidian.normalizePath(`${this.app.vault.adapter.basePath}/${file.path}`);
// debug: this.app.vault.adapter.basePath = "/Users/ludwigws/OneDrive/MyNote", file.path = "202109010933 Obsidian open with app.md"
// path = ""Users/ludwigws/OneDrive/MyNote/202109010933 Obsidian open with app.md"
// I fixed it temporarily by adding this
if (!path.startsWith("/")) {
path = "/" + path;
}
if (obsidian.Platform.isDesktopApp && navigator.platform === "Win32") {
return path.replace(/\//g, "\\");
}
return path;
}
For the mac app "CleanShot X", the generated command ID is open-with:open-file-with-cleanshot x
Notice the space right before the x
.
Unfortunately this means that I cannot create a shortcut with https://github.com/esm7/obsidian-vimrc-support#executing-obsidian-commands-with-obcommand because spaces aren't allowed.
Can spaces be converted to -
? Thanks
thanks for this tool,
small issue:
assuming linux ubuntu 22 machine,
assuming I want to open an image with program eog
assuming the image is named awesome image.png
The command sent will be:
eog <path>/awesome image.png
which will fail.
the program should \
the whitespace
the program should eog <path>/awesome\ image.png
This is a shell command to open any file with the default program in windows.
That would be a good default to have.
Can someone help me try to get this to work on macOS.
I want to be able to edit some docs with MacVim.
So I have the path set as /opt/homebrew/bin/mvim
but nothing happens and there are no errors in the Web console either.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.