























本文彙總了幾種在Obsidian裡快速開啟常用筆記的方法:
最近開啟過的筆記會顯示在Recnet Files面板,方便隨時存取。
將常用筆記記錄在特定的筆記裡(例如我使用的[[!!! StartHere !!!]],可視為Hub,中樞筆記):
Hub筆記可使用Hotkeys for specific files外掛設置快捷鍵以方便操作。
不使用Hotkeys for specific files的話,也可以使用QuickAdd巨集來設定快捷鍵。
/**
home.js
功能: 開啟首頁
*/
const homePage = "!!! StartHere !!!";
const openMode_ = "preview"; // preview, source or default
const isNewPanel_ = true; // 是否用新面板開啟
module.exports = async function home(params) {
const app = params.app;
const files = await app.vault.getMarkdownFiles();
const selectedFile = files.filter(file => file.name === homePage + ".md")[0];
if (selectedFile) {
if (isNewPanel_) {
const leaf = app.workspace.splitActiveLeaf();
leaf.openFile(selectedFile, { state: {mode: openMode_} });
app.workspace.setActiveLeaf(leaf);
} else {
app.workspace.activeLeaf.openFile(selectedFile)
}
} else {
new Notice("找不到檔案: " + homePage + ".md", 5000)
}
}在專門放置按鈕的筆記(如!Buttons)裡加入要使用的筆記按鈕:
```button
name !WS網路服務
type link
action obsidian://advanced-uri?filepath=!WS網路服務
color red
```
^button-note-wsaction使用Advanced Obsidian URI寫法,以filepath參數指定要開啟的檔案。
在Hub筆記裡以行內按鈕引用:
`button-note-ws`使用QuickAdd的巨集撰寫JavaScript,並綁定熱鍵以在選單裡搜尋要開啟的檔案。
📝select_file.js原始碼:https://gist.github.com/emisjerry/1d6426fcb20360f996f318f1104c6c1e
使用AutoHotkey的Run+Advanced Obsidian URI即可在外部直接開啟筆記。
;; Open Obsidian Notes
;; Hotkey: Ctrl+Shift+O
;; Author: emisjerry, http://jdev.tw/blog/
#SingleInstance Force
^+o::
InputBox, sText, 開啟筆記, 請輸入筆記檔名(.md不輸入):, , 400, 150, , , , , %Clipboard%
if (ErrorLevel == 0) {
Run obsidian://advanced-uri?filepath=%sText%
}
return##
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。