<%* /**
- Using Advanced URI Plugin to open specified settings.
- settingid: Normally the plugin's folder name. We can find the correct id in plugin's manifest.json
- Hotkey: Alt+S
- Ref: Obsidian Advanced URI: https://vinzent03.github.io/obsidian-advanced-uri/actions/settings_navigation */ let oSettingsJson = { "Core: Appearance": "appearance", "Core: Community plugins": "community-plugins", "Core: Plugin browser": "plugin-browser", "Core: Theme browser": "theme-browser", "Core: Settings": "app:open-settings", "Core: Hotkeys": "hotkeys", "Core: Editor > Behavior": "editor>Behavior", // ">" indicates settingsection; 行為 "Plugin: BRAT": "obsidian42-brat>Beta Plugin List", "Plugin: QuickAdd": "quickadd", "Plugin: Open-plugin settings": "open-plugin-settings", "Plugin: Commander": "cmdr", "Plugin: Keyshots": "keyshots", "Plugin: Soundscapes": "soundscapes", "Plugin: Code Styler": "code-styler", "Plugin: Templater": "templater-obsidian", "Plugin: Style settings": "obsidian-style-settings", "Plugin: Other settings":"!obsidian42-brat:BRAT-opentPluginSettings", // "!" indicates executes by command ID "File: Cmd-open-settings-by-uri.md":"@010-Templates/Cmd-open-settings-by-uri.md", // "@" indicates opens file (with path) //"Other settings":"!open-plugin-settings:open-other-plugin-settings" };
let aDisplays = Object.keys(oSettingsJson); let aValues = Object.values(oSettingsJson);
let sValue = await tp.system.suggester(aDisplays, aValues, false, "選擇要設定的外掛"); // (displays, values,...) if (!sValue) return; //console.log(sValue); if (sValue.startsWith("!")) { // Command ID sValue = sValue.substring(1); await app.commands.executeCommandById(sValue); } else if (sValue.startsWith("@")) { // Open file sValue = sValue.substring(1); const oFile = await app.vault.getAbstractFileByPath(sValue) await await app.workspace.getLeaf("tab").openFile(oFile); } else if (sValue.contains(">")) { // Handle settingsection let iIndex = sValue.indexOf(">"); let sID = sValue.substring(0, iIndex); let sSection = sValue.substring(iIndex+1); window.open("obsidian://advanced-uri?vault=MOC&settingid=" + sID + "&settingsection=" + sSection); } else { window.open("obsidian://advanced-uri?vault=MOC&settingid=" + sValue); } -%>