ObsidianShell icon indicating copy to clipboard operation
ObsidianShell copied to clipboard

Is there a way to make the note open in a new window?

Open g-adel opened this issue 2 years ago • 9 comments

Hi! I've been using this script as a quick way to search for and open notes, using Everything program. However, it'd really help with my flow if the opened note is ina new window in obsidian (Same way as clicking on Move to new window on a tab in Obsidian.) Do you know if this is possible and how? Thanks a lot!!

g-adel avatar Jan 19 '23 19:01 g-adel

I've tried to do this before, but Obsidian doesn't provide an API for it. There are workarounds, such as writing an Obsidian plugin to inject code, or using UI Automation to operate the GUI, but they're all a pain.

Chaoses-Ib avatar Jan 21 '23 16:01 Chaoses-Ib

Hi! Just wanted to inform you that Advanced URI allows for new tabs (even hover window from Hover Editor) from the URI: https://vinzent03.github.io/obsidian-advanced-uri/concepts/navigation_parameters. Of course it'd be nice if your script runs regardless of whether the user has the plugin or not. I'll check if that's possible.

g-adel avatar Feb 20 '23 21:02 g-adel

It works like a charm! I'll release a new version in the next few days.

Chaoses-Ib avatar Feb 21 '23 16:02 Chaoses-Ib

That's great! btw, there's also an option to make the note open in a new window, which might be an interesting option. For me, this script is great for using it with Flow Launcher to search for and open Obsidian notes. So it'd be amazing if I could just have note open in a separate small window where I can see it and then close it without switching to Obsidian's main window.

g-adel avatar Feb 21 '23 17:02 g-adel

Yeah, I've seen your issue at https://github.com/Vinzent03/obsidian-advanced-uri/issues/115. There are at least two ways to solve this (for Windows):

  • Before opening a note in a new window, save the visibilities and z-orders of all Obsidian windows and move the invisible ones to off screen. After opening, restore their visibilities, z-orders and positions.
  • After opening, always hide the Obsidian window below the current one.

Chaoses-Ib avatar Feb 21 '23 18:02 Chaoses-Ib

That seems like really complicated for you to do. I've started using the Fluent Search app for an immediate preview. Will you update the shell file for the URI new tab functionality soon?😃

g-adel avatar Mar 05 '23 22:03 g-adel

v0.4 is now released. Sorry for the late. I was busy with my school and my job.

Chaoses-Ib avatar Mar 12 '23 17:03 Chaoses-Ib

Although v0.4 supports opening a note in a new window without activating the vault window, there are two problems:

  • If the vault hasn't been opened, then the vault window and any windows in the workspace will be displayed.
  • When you close the window, the vault window will be activated.

The two problems are difficult to solve. So I decided to release v0.4 first. Maybe I will solve them in the future... 😩

Chaoses-Ib avatar Mar 12 '23 17:03 Chaoses-Ib

Oh this is awesome! This is already so great! I'm not sure there's more you can do about closing the window without creating a plugin for Obsidian. Thanks a lot :D

g-adel avatar Mar 14 '23 16:03 g-adel