[Obs#35] Buttons外掛開啟筆記自動化操作契機⁉️
語法
button語法
```button name required type required action required color optional class optional id optional replace optional remove optional ```
- 第一行必須是name (筆記裡唯一名稱)
```button name 瀏覽簡睿隨筆 type link action https://google.com remove false ```
type類型
- command
- link
- template
- calculate
選項
argument | description | options | example |
---|---|---|---|
name | required: the name of the button | any string | My Button |
type | required run a command or open a url | command, link, template, calculate | command |
action | required depending on button type this will be a command, link, template, or equation | Toggle Pin or https://obsidian.md or My Template or 1+2 | Toggle Pin |
color | optional: arg to change color of the button | blue, green, red, purple. yellow | blue |
class | optional: add a class to the button for more customized styling. Adding a custom class will remove default classes(全部小寫) | a string representing your custom class | button-default, button-shine |
id | optional: add a custom id to the button for styling | a string representing your custom id | myId |
remove | optional: if true removes button after command runs | true | true |
replace | optional: specify a section header above the button and it will remove content from the section (and replace if used with prepend template)(replace true要在最後一行) | The section header directly above the button | ## Replace this Section| undefined undefined undefined undefined undefined |
按鈕範例
1. 命令按鈕
```button name 匯出 PDF type command action 匯出 PDF remove false ```
```button name 釘選切換 type command action 釘選切換 remove false ```
```button name 切換焦點到右側面板 type command action 切換焦點到右側面板 remove false ```
2. 連結按鈕
```button name 瀏覽簡睿隨筆 type link action http://jdev.tw/blog ```
```button name 開啟新建立newnote1 type link action obsidian://open?vault=MOC&file=newnote1#^top ```
3. 樣板按鈕
樣板按鈕
1. prepend template: 在按鈕前面插入指定樣板之內容
2. append template: 在按鈕後面插入指定樣板之內容
2. note(檔名路徑) template: 用指定的樣板建立新筆記到指定位置
4. 使用Templater外掛要勾選【Trigger Templater on new file creation】
```button name 在按鈕前面插入test-loop樣板 type prepend template action test-loop ```
```button name 在按鈕後面插入test-loop樣板 type append template action test-loop ```
```button name 用test-loop樣板建立新筆記 type note(/newnote1) template action test-loop ```
4. 運算按鈕
```button name Add 1+2 type calculate action 1+2 ```
Result: 3
$行號取值:全形冒號後要有空白
商品名稱:iPad Pro 商品單價: NT$ 24000 購買數量: 3 ```button name iPad購買金額 type calculate action $204*$205 ``` Result: 72000
相關連結
教學影片
##
您可能也會有興趣的類似文章
- [Obs#42] Buttons外掛 0.4.5 新功能 (0則留言, 2021/05/19)
- Obs149-左邊長筆記,右邊卡片的編輯佈局:Query Control, Note Gallary (0則留言, 2024/01/28)
- [Obs#88] 綜合練習:快速設定的6種方法─使用8個Obsidian外掛 (0則留言, 2022/05/21)
- [Obs#73] Bartender(酒保)讓側邊欄不再擁擠,也強化檔案瀏覽器過濾與自訂排序功能;Customizable Sidebar可自訂側邊欄圖示 (0則留言, 2022/02/26)
- [Obs#58] 快速開啟常用筆記的方法 (0則留言, 2021/10/23)
- [Obs#56] 快速新增靈感/閃念筆記(Fleeting Note)的3種方法 (0則留言, 2021/10/10)
- Obs135|解鎖簡易Dataview查詢:驚人的SQL技巧,使用Query All The Things(QATT)外掛 (0則留言, 2023/08/19)
- Obs140|Obsidian進階全文檢索與複製結果的外掛-Query Control、Better Search View、Float Search、Text Expand、File Cooker (0則留言, 2023/09/15)
- Obs139|5個方便維護Properties的外掛:Linter、TagMany、File Cooker、Tag Wrangler、Templater Hotkeys (0則留言, 2023/09/10)
- [Obs#95] Obsidian v0.16對於使用介面的強化🚀 (0則留言, 2022/09/04)
- Obs152|終於能產生書籤與頁碼了!與PDF相關的外掛:Better Export PDF&PDF++ | 修訂 (0則留言, 2024/02/18)
- Obs158|Copilot for Obsidian自訂提示詞與命令 (0則留言, 2024/03/24)
- [Obs#71] 新手適用的多功能模板外掛:From Template (0則留言, 2022/02/19)
- [Obs#68] 利用QuickAdd巨集由IMDB建立影片檔案,用Minimal主題顯示成卡片 (0則留言, 2022/02/06)
- [Obs#59] Obsidian快速開啟常用筆記(2):不使用外掛的簡單方法 (0則留言, 2021/10/27)
Sorry, 很久沒用Google sc…