Giter Club home page Giter Club logo

obsidian-advanced-uri's Introduction

Vinzent

Hey, I'm a student from Germany building apps with Flutter and plugins for Obsidian.

If you want to support me you can consider:


ko-fi

obsidian-advanced-uri's People

Contributors

chaoses-ib avatar chrisgrieser avatar darkluna999 avatar gr-nobel avatar leoccyao avatar luckman212 avatar praeses0 avatar tonymynd avatar vinzent03 avatar wudanyang6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

obsidian-advanced-uri's Issues

[Feature Request] Add "Copy Advanced URI" to Hotkeys section (and Command Palette)

As far as I can tell, the "Copy Advanced URI" command is currently only available in the "More options" menu. It would be great, if we could invoke it with a quick keyboard shortcut instead of having to reach for the mouse, click on the the little "More options" menu button, and then click on the actual command inside that menu.

Thank you so much for this fantastic plugin. It's really filled to the brim with insanely useful features.

Add URI builder for daily notes

HOW

Using a link like: obsidian://advanced-uri?vault=MyDaily&daily=true&data=%3C%25%20tp.file.cursor%20%25%3E&mode=append

And the append action fails with no data append to the daily note.

Is it a bug for Obsidian or just a bug for the plugin?

URI to save current workspace

I see two methods of implementing this:

  • A parameter like for example save-current=true to save a workspace before changing to a different workspace.
  • A separate URI for saving the current workspace, which can be run before the loading of a different workspace.

Not sure which implementation makes more sense, the latter is more fine grained control, while the former is more compact as it is only one URI.

[FEAT?] Add daily note support

WHAT

If I want to quick add data to daily note, it will be hard to change the date everyday, OR i should write a script for myself.

**But I think it is hard to code this feature, so this issue is just an inspiration **

HOW TO

Argenos had coded a similiar feature before. https://github.com/argenos/nldates-obsidian

HOW IT COULD BE

It would be nice that make a parameter like daily?

like obsidian://advanced-uri?vault=<test-vault>&timepath=%DD%%MM%%WW%%20Weekly%20Note&data=<text>&mode=append

Check if note exists using Advanced URI?

Hello!

From time to time you need to know if a note exists already to decide if you need to write or append to it. On desktop I can use AppleScript or tools like Keyboard Maestro to check if note exists before writing (I'm on Mac). But on iOS there is no easy way to do the same using Shortcuts.
Any chance you can implement checking for note existence with Advanced URI?

Thanks a lot!

Better integration with Hook

Is it possible to support smoother integration with Hook as discussed in the following post?
https://discourse.hookproductivity.com/t/link-obsidian-with-advanceduri-plugin/4691/6

Hook is not able to get the advanced URI. Currently, it seems it is impossible to set a shortcut for just copying advanced URI without bringing up the UI. Besides it would be better to have proper automation without UI scripting

If the advanced URI plugin provide the following two we could provide integration:

“copy advanced markdown URI” for both title and url.
Allow the user to set a shortcut for “copy advanced markdown URI” without bringing up the UI so Hook can use the shortcut to > get the markdown URI.

However, much better would be to provide x-callback-url support in the plugin. Or other automation. Is that there or possible?

open file in new pane?

Hi, I have this command using your plugin with a bash script that does work to open a file:

xdg-open "obsidian://advanced-uri?vault=${VAULT2}&filename=${FILE4}"

Is there a way to force it to open the file in a new pane? I'm usually viewing my files in obsidian but if they're not already linked in the current file calling them up with a rofi (bash) script to open them. 99% of the time I'd like to see the new file beside the current one, not replacing the current one. Is this possible using your plugin (or any other way you can think of?)

I see a reference to your other plugin "obsidian-shortcuts-for-starred-files" that has that, but not sure if this functionality is also in the obsidian-advanced-uri plugin or not

thank you!

  • Dave

how to specify preview mode?

Hi all

im trying to create a complex (well at least to me since im suck :) ) obsidian advanced URL to launch from within ios shortcuts.

this is the current state of what works

obsidian://advanced-uri?vault=Food&filepath=CQ/title&data=body

this does create a note with title and a body body which is great. but it always opens in reading mode

I've read that you can use view mode to specify the mode it will open in. yet for the life of me i cannot get it to work or follow the correct syntax for this

can anyone guide me

also can one launch a insert template after the advanced URI launches?

thx so much

Z

copying URI does not work on mobile

The plugin works great in Obsidian Windows version but although it installs ok but no functionality is working in Obsidian Android version. I really like to see it working on mobile as well. Thanks again.

Minor FR: URI to Add a folder as vault

Basically, I am wondering whether it is possible to add a URI that adds a folder as a new vault, as would happen when you click this button.

image

The command could be sth like obsidian://advanced-uri?open-as-vault={URI-encoded-folder-path}?

Can't create daily note and append to heading in one step

Thanks for your work on this useful plugin, @Vinzent03.

My daily notes all start with a template from the core Templates plugin, which includes a heading for "Reading Notes." I've been using the following URI as part of a shortcut on iOS to add text under that heading:
obsidian://advanced-uri?vault=<vault>&daily=true&heading=Reading%20Notes&data=<text>&mode=append&viewmode=source

If the daily note already exists, it works beautifully. However, if the daily note hasn't been created yet, nothing happens.

If I use the same URI without the heading=, it also works, creating a daily note and appending text to the bottom. But when I try to create a daily note and append to a heading at the same time, it consistently fails.

Bug: Search & Replace

Hey! Thanks for this amazing plugin.

I have run into an issue with search and replace. Here's the error:

image

This is the command I wanted to run: obsidian://advanced-uri?vault=Vault&filepath=Current%20Weekly%20Review.md&search=[x]&replace=[%20].

I made sure the plugin is updated and my Obsidian version is v.0.11.13.

Append to heading dont work on the last heading

When I try to append to the last heading of a page and have a trailing comment, the last heading append, dont work.
202202 - Obsidian - 2022-02-23 at 13 44 20

Syntax used:
obsidian://advanced-uri?vault=MyVault&uid=testingpage&heading=Heading1&data=Heading1Test&mode=append

URI Fails to complete

I'm using an iOS Shortcut to create a URI to generate a page. This includes dataviewjs blocks. The process of generating the page fails at the same point, but I cannot understand why.

This is the URI:

obsidian://advanced-uri?vault=PPTN&filepath=More%20Testing/More%20Testing%20Dashboard&data=---%0Atype:%20project%0Aproject-start:%202022-01-13%0Aproject-due:%20%0Aarea:%0Atags:%20%5B%5D%0A---%0A%0A%5B%20%5B%5BMain%20Dashboard%7C%F0%9F%97%84%EF%B8%8F%5D%5D%20-%20%5B%5BMore%20Testing%20Dashboard%20%7C%F0%9F%93%81%5D%5D%20-%20%7C%7C%20%5B%F0%9F%93%8A%5D(obsidian://advanced-uri%3Fvault%3DPPTN%26workspace%3DGraphs)%20-%20%5B%F0%9F%93%B1%5D(obsidian://advanced-uri%3Fvault%3DPPTN%26workspace%3DMobile)%20%5D%0A%5Eheader-links%0A%0A---%0A%0A%23%20Project%20Info%0A%0A%3E%20%23%23%20More%20Testing%0A%3E%20%23%23%20Start:%20%60%3Dthis.project-start%60%0A%3E%20%23%23%20Due:%20%60%3Dthis.project-due%60%0A%0A---%0A%0A%23%20Tasks%0A%0A!%5B%5BButtons%23%5EmakeTask%5D%5D%0A%0A%60%60%60dataviewjs%0A%09dv.taskList(dv.pages('%22More%20Testing/001-Tasks%22').file.tasks.where(t%20%3D%3E%20!t.completed).sort(f%20%3D%3E%20f.due),%20false%20)%0A%60%60%60%0A%0A---%0A%0A%23%20Notes%0A%0A!%5B%5BButtons%23%5EaddNote%5D%5D%0A%0A%60%60%60dataview%0Alist%20from%20%22More%20Testing/002-Notes%22%0A%60%60%60%0A---%0A%0A%23%20Resources%20%0A%0A!%5B%5BButtons%23%5EmakeResource%5D%5D%0A%0A%60%60%60dataview%0Alist%20from%20%22More%20Testing/003-Resources%22%0A%60%60%60%0A%0A---%0A%5B%20%5B%5BMain%20Dashboard%7C%F0%9F%97%84%EF%B8%8F%5D%5D%20-%20%5B%5BMore%20Testing%20%7C%F0%9F%93%81%5D%5D%20%5D%0A%5Efooter-links

And it should generate this Markdown:

`

type: project
project-start: 2022-01-13
project-due:
area: employment
tags: [jobs]

[ [[Main Dashboard|🗄️]] - [[LSB Technical College Dashboard |📁]] - || 📊 - 📱 ]
^header-links


Project Info

LSB Technical College

Start: =this.project-start

Due: =this.project-due


Tasks

![[Buttons#^makeTask]]

	dv.taskList(dv.pages('"LSB Technical College/001-Tasks"').file.tasks
	.where(t => !t.completed)
	.sort(f => f.due),false)

Notes

![[Buttons#^addNote]]

list from "LSB Technical College/002-Notes"

Resources

![[Buttons#^makeResource]]

list from "LSB Technical College/003-Resources"

[ [[Main Dashboard|🗄️]] - [[LSB Technical College Dashboard |📁]] ]
^footer-links
`

The point where it fails is:
dataviewjs dv.taskList(dv.pages('"LSB Technical College/001-Tasks"').file.tasks .where(t => !t.completed) .sort(f => f.due),false

Essentially, after 'false', the process of creating the content in Obsidian stops.

Any idea what is causing this?

Many thanks

Minor Feature Request: URI to Open Plugin/Theme Browser + Update All

I noticed after a while, that there are three things in the settings that I open very regularly, so speeding up the process via URI might be useful. In particular:

  • trigger the "Update All Community Plugins" Function
  • open the Community Theme Browser
  • open the Community Plugin Browser

Right now, via the settingid URI, I can only access the community plugin tab, and the appearance tab, creating an unnecessary extra step. This is only a super minor feature request, so no hurry at all! :)

"Open" action got stuck for several seconds sometimes

Thank you for the great plugin! I use this plugin a lot. There is an issue that has been bothering me for a long time. The "Open" action got stuck for several seconds sometimes, before opening the target page. It doesn't happen every time. There is no error message in the DevTool console.
What could be the reason? Or How could I debug this issue?

Potential file loss?

Hi,

I am using Advanced URI on iOS in my shortcut to append a clipping (e.g. website) to my Daily Note like this:

obsidian://advanced-uri?daily=true&mode=append&data=

My vault is synced between Mac and iOS via iCloud. Today (and I think also yesterday) I noticed that my daily note got overwritten by my iPhone - theory is that the following happened:

  1. I wrote the note on Mac
  2. I ran the Shortcut, i.e. asked advanced-uri to append to my daily note
  3. Instead of downloading the note from iCloud, advanced-uri saw it was missing and created it (I hadn't opened Obsidian on iOS on that day)
  4. Boom

Not sure Advanced URI is the culprit, but maybe you could have a look if the above theory could be plausible and fixed from advanced URI side (e.g. change step 3).

Workspace parameter not opening workspace on Windows

Using the workspace parameter in an Obsidian URI to load a workspace works for me on Mac, but if I try the same URL on Windows, against the same vault, and with exactly the same workspace name set up, it does not work. When the URI is opened on Windows, the Obsidian app is opened, or is switched to the foreground, but no loading of the workspace takes place. When doing this on Mac, the workspace loads immediately .

  • Other URI I have tried work on both platforms, and plugin is enabled on both.
  • Restarting the Obsidian app made no difference.
  • Remove and readded the plugin, but to no avail.

e.g. this URI works for me on Mac but not on Windows against the same vault and configuration.

obsidian://open?vault=demo&workspace=1-Main

Windows: 10 (21H1, build 19043.1165)
Obsidian: 0.12.15
Advanced Obsidian URI Plugin: 1.11.1

URI to Random Note

Would it be possible to add a URI for random note in a vault?
I have found mention the functionality in command-uri-obsidian, but it is not working today , and repo abandoned.

URI for close vault

Would it be possible to add a URI for closing a vault?
Currently it's not really possible to switch between vaults.
One workaround I could think of would be to close the current vault first before opening it.

Feature request: Open with an alias

Right now, when I use filename=Toby a new file is created even though I have a document that has that alias. Is it feasible to add a parameter, say name feasible that opens the file with that if it exists, the file that alias if that exists and only if neither do creates a new file?

open note OR reveal already open note

Your plugin is super useful. I use it to allow me to open files from a bash script (from a rofi search as well as other bash scripts e.g. from a crontab reminder type thing) as that's quicker than using the native Obsidian search.

The one slight wrinkle is that I get a lot of repeat notes all open at the same time. Is there a way with your plugin (or any other way you know off the top of your head) to have it "go to" the already open note if it has been opened previously?

this is what I'm using to open my notes:
xdg-open "obsidian://advanced-uri?vault=${VAULT}&filename=${FILE}"

thanks,

  • Dave

Open note without opening a new pane?

Hi @Vinzent03 - great plugin!

I am using it to open my daily note, with e.g. obsidian://advanced-uri?vault=main&daily=true

It works, but always opens a new pane instead of just switching my current pane to the daily note (which is what Obsidian's native URI open does). Is there any way to fix or control this? Even if I have the daily note open, it still opens a new pane.

Uncaught (in promise) URIError: URI malformed, problem with symbol "%"

there is a problem when uri contains symbol "%"
origin text is increase 100%
after url encode increase%20100%25
so, when I try to open this url
obsidian://advanced-uri?vault=notes&daily=true&mode=append&data=increase%20100%25

it does't work

Uncaught (in promise) URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at AdvancedURI.eval (eval at <anonymous> (app.js:1), <anonymous>:3462:69)
    at step (eval at <anonymous> (app.js:1), <anonymous>:72:23)
    at Object.eval [as next] (eval at <anonymous> (app.js:1), <anonymous>:53:53)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:46:71)
    at new Promise (<anonymous>)
    at __awaiter (eval at <anonymous> (app.js:1), <anonymous>:42:12)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:3452:100)
    at t (app.js:1)
    at <anonymous>:1:52

`search` and `searchregex` don't work with `daily=true`

Steps to reproduce:

  • Put abc somewhere in the current daily note (in my case, Periodic/Daily/2021-11-12).
  • Open obsidian://advanced-uri?daily=true&search=abc&replace=123.

Expected: The abc should be replaced with 123.
Actual: Nothing changes.


Notably, as expected:

  • obsidian://advanced-uri?filepath=Periodic%252FDaily%252F2021-11-12.md opens the file.
  • obsidian://advanced-uri?daily=true also opens the file.
  • obsidian://advanced-uri?filepath=Periodic%252FDaily%252F2021-11-12.md&search=abc&replace=123 replaces abc with 123.

[Feature Request] Append/Prepend text to a specific note without opening Obsidian

Hello again @Vinzent03 !!!!!!

I'd like to make a request related to these amazing URI:

obsidian://advanced-uri?vault=<my_vault>&filepath=<my_file.md>&data=<my_data>&mode=prepend

obsidian://advanced-uri?vault=<my_vault>&filepath=<my_file.md>&data=<my_data>&mode=append

My suggestion is a new option to NOT open Obsidian while doing this URI.

In other words: append/prepend text to a specific note without opening Obsidian (background)

Why are you asking this?

Let me explain :)

  • This week I started using Obsidian Mobile on iOS;
  • I have a note in Obsidian called INP.md that I use to put everything that comes to my mind that I don't want to deal in the moment (TODO, reminders, links, short text ...)

My idea is to send (append/prepend) information to INP.md on Mobile using URI and the Shortcuts App. After searching in our forum, I wrote two shortcuts that uses your amazing plug-in to append/prepend information to this INP.md note.

—> This one uses the clipboard to prepend to the note

60A4AF6B-CA46-4D65-839E-2901301F8952

—> This one opens a modal that let me write what I want to remember and prepend to the note

846E8723-22A3-45E2-A925-72134D0C9C7F

This is amazing, but every new input that I send via URI, Obsidian Opens and I have to get back to the previous App that I was using.

Would be amazing to have a way to send information via URI on background (without opening Obsidian) :)


I hope my FR is feasible and I hope you liked :)

Thanks again for all your help. Is always a pleasure talking to you.

I wish you a fantastic day!!!!!!

Preferably use the Command ID, not the Command Name. Why and how to find the ID?

Thanks for another useful plugin @Vinzent03 —and even more thanks that you didn’t forget us multi-lingual people who switch the Obsidian language often, by allowing us to use the Command ID instead of its name!

I’ve missed that a lot in the Buttons and Obsidian Leaflet plugins: Whenever one switches Obsidian’s language, the command names used aren’t the same anymore and all logic breaks. Not so when using the Command IDs instead.

Since there is unfortunately no official list of command ids (and plugins can add to the commands anyway), you can use my Obsidian Command and Hotkey List (new version) to show command ids and their currently assigned hotkeys within Obsidian. This requires the Dataview plugin to be installed and operational.

Here’s the link to the code, in the Obsidian Forums:
https://forum.obsidian.md/t/dataviewjs-snippet-showcase/17847/37

Append to a section

How hard would it be to add the ability to append to a section, noted by a header reference like ###Section?

X-Callback-URL and Shortcuts Actions

This plugin is excellent. I am using it with Obsidian for macOS and iOS through shortcuts mostly (although just having a link has been helpful in my task manager as well).

It does work to use the action X-Callback-URL, you can also see the general spec page. When I run that action, it just seems to just hang and not finish. Having the ability for these URLs to speak back to the application that sent them is a nice addition, especially if there is a sequence of steps. A workaround that currently works is to use the action "Open URL" and this will allow me to manipulate data in multiple different obsidan documents.

[BUG?] Cannot use # in data

WHAT

When I use # in data, the data would be null when obsidian recieve it.

like:

obsidian://advanced-uri?vault=MyBrain&filepath=_Inbox%2Fjournals%2F2021_04_02&data=##%20TODO%20test&mode=append

would send an object:

image

HOW

Don't know if it is a bug.

Openening a note also reactivate the left pane to reveal the note

Hi,

I'm using Obsidian Advanced URI with an Alfred workflow to open my notes directly from Alfred. When I activate the Advanced URI plug-in, opening a note also reactive the left panel and reveal where the note is located, which is a bit annoying. Any idea how to avoid that?

Copy advanced-uri to clipboard

no any option, no any shortcuts.

obsidian://advanced-uri?vault=vaultName&file=Test%2F2


I found the uri is diff : obsidian://advanced-uri?vault= vs obsidian://open?vault=

Why not add option in obsidian://open?vault=<your-vault>&filepath=my-file&heading=Goal ???

feat: Open note without `data`?

It would be really nice if specifying a filepath but no data would just open the given path.

I'm building some iOS Shortcuts to automate some flows, and I'd love to rely only on obsidian-advanced-uri instead of switching between this and the official open action depending on whether or not I have data

Right now it looks like this case is ignored by registerObsidianProtocolHandler, when it can probably just be implemented with this.app.workspace.openLinkText(parameters.filepath, "");

A nice-to-have would be if the cursor were at the appropriate position based on mode=append or mode=prepend

Double Encoded URI

It looks like URIs must be double encoded. Is this intended behavior?

Encode examples

Raw
<\\%

Encoded
%3C%5C%5C%25

Double Encoded
%253C%255C%255C%2525

Plugin test example

Run this in your console

 open("obsidian://advanced-uri?vault=" + encodeURI(app.vault.adapter.basePath.split("\\").reverse()[0]) + "&searchregex=" + encodeURI(encodeURI(/<\\%/g)) + "&replace=" + encodeURI(encodeURI("<%")))

On this content

<\% tp.frontmatter.field %>


If this is intended behavior, it may be helpful to others if the README page mentions it.

[Feat] Could the Data be appended to the End of file?

WHAT

I found that the append mode allows us to append data to the begining of the file. But I think append means that add things to the end, and prepend means that add things to the beginning.

HOW

I think it would be nice that add an action name: prepend and append. That are both useful for people.

Thanks for building such a good job.

Feature Request: URI to open specific settings tabs

Well, as I mentioned in Discord: A feature to open specific settings-tabs would be great. e.g. obsidian://advanced-uri?settingid=editor would open the editor settings and obsidian://advanced-uri?settingid=hotkeys would open the hotkeys.

How to create markdown note using both UID and file path?

Thank you for this amazing plug-in, which solves the problem of obsidian unstable links.
I have a feature request.
How to create markdown note using both UID and file path?
I hope it can be achieved through the link below, but it doesn't seem to work.
obsidian://advanced-uri?vault=knowledgehub&filepath=markdown%2F002_avatar%2Fa.md&uid=123
Of course, UID is preferred when matching.
This feature is very important to me. Could you consider supporting it?

[feature request]: support text fragment

The scroll to text fragment feature provides support for specifying a text snippet in the URL hash. So if I click a link that specifies a fragment, I would be navigated to that fragment of text on the page.

if obsidian-advanced-uri support it , I guess I can link any character from any document. This is more elegant than the obsidian block reference.

Some links to understand text fragment:

Thank you for any replies.

Support copying links to workspaces

Currently, there are options for copying links to files, commands, etc. It would be great if there can be a command for copying links to workspaces.

Open a note in preview mode

I want to always open a node in preview mode (as opposed to editor mode).

Is it possible for Advanced URI to support this? How complicated will this be? Happy to create pull request if you can give me some idea how to do it.

how to open url with templater

when the file in url is no, the lumberjack of plugin can create new file with templater, ,but advance url only creat a new file without templater , i think your plugin is much better than it maybe I was not be able to find the function, Could you tell how to set it,thanks

Item Author Missing in Plugin list

just a minor thing, but since since this is such a wonderful plugin, I think you deserve to have your name there as with all the other plugins

Screenshot 2022-02-02 16 46 54

`line in file` command seems to not work?

Hi again

This is similar to my previous issues where i may be doing something wrong but i cant see any examples :)

to my understanding the line in file command should open the note with the cursor on the line #? is that correct?

if so i have this example

obsidian://advanced-uri?vault=Food&filepath=CQ/test&viewmode=source&data=XXX%0D%0A333&line=2

which creates the test file but never moves the cursor to line #2

any tips?

thx

Z

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.