up::[[obsidian plugins]] link::https://github.com/Vinzent03/obsidian-advanced-uri title::"utiliser des URI pour faire différentes actions dans obsidian" #obsidian ---- > [!tip] > Use command line (my `urlencode` alias) to encode with the `%` notation # Opening files | | parameters | explanation | | ---------------------- | --------------------------- | -------------------------------------------------------------------------------------------------- | | workspace | `workspace` | opens the workspace called `workspace` | | save current workspace | `saveworkspace=true` | Saves the current workspace. (Can be combined with `workspace` to open a new workspace afterwards) | | file | `` | opens file | | line in file | `, line` | opens `line` in file | | heading | `, heading` | opens `heading` in file | | block reference | `, block` | opens `block` in file | | settings tab | `settingid` | opens a setting tab by id | > [!example] Examples > Open **workspace** "main": > `obsidian://advanced-uri?vault=&workspace=main` > Open **heading** "Goal" in "my-file.md" (**Important:** Without syntax, only `Goal`): > `obsidian://advanced-uri?vault=&filepath=my-file&heading=Goal` > Open **block**-id "12345" in "my-file.md" (**Important:** Without syntax, only `12345`): > `obsidian://advanced-uri?vault=&filepath=my-file&block=12345` # Editing files | | parameters | explanation | | --------- | ---------------------------- | ----------------------------------------------------------------- | | write | `, data` | Only writes `data` to the file if the file is not already present | | overwrite | `, data, mode=overwrite` | writes `data` to `filepath` even if the file already exists | | append | `, data, mode=append` | only append `data` to the file | | prepend | `, data, mode=prepend` | only prepend `data` to the file | | new | `, data, mode=new` | creates a new file. if `filepath` already exists, an incrementing number is appened | > [!example] Examples > **Write** "Hello World" to "my-file.md": > `obsidian://advanced-uri?vault=cours&filepath=my-file&data=Hello%2520World` > **Overwrite** "This text is overwritten" to "my-file.md": > `obsidian://advanced-uri?vault=&filepath=my-file&data=This%2520text%2520is%2520overwritten&mode=overwrite` > **Append** "Hello World" to today's **daily note**: > `obsidian://advanced-uri?vault=&daily=true&data=Hello%2520World&mode=append` > **Append** content from the **clipboard** to today's **daily note**: > `obsidian://advanced-uri?vault=&daily=true&clipboard=true&mode=append` # Navigation parameters ## View modes Just put one of the following parameters : - `source`: sets to "reading: source mode" - `live`: sets to "reading: live mode" - `preview`: sets to preview mode ## Open in new pane the `newpane` parameters tell if the uri should be opened in a new pane accepts `newpane=true` or `newpane=false`