我是靠谱客的博主 自然大白,这篇文章主要介绍【AHK】在Obsidian中以选定日期生成链接,现在分享给大家,希望可以做个参考。

定义一个热键 ctrl+q 会显示一个日历,然后根据选择日期 生成一个链接

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#IfWinActive ahk_exe Obsidian.exe ^q:: answer := Dialog("请选择一个日期,本工具会以wiki链接形式输出", "good") send [[%answer%]] return Gui, Add, MonthCal, vMyCalendar gButton Gui, show Dialog(Question, DefaultValue := "") { return new Dialog(Question, DefaultValue).Wait() } class Dialog { __New(Question, DefaultValue) { Gui, New, +hwndhGui +LabelDialog.On_, Dialog this.hwnd := hGui Gui, Add, Text,, % Question ; Gui, Add, MonthCal, hwndhEdit vMyCalendar gButton Gui, Add, MonthCal, hwndhEdit this.hEdit := hEdit Gui, Add, Button, gDialog.On_ButtonSendAnswer, 确定 this.SaveStatus := False Gui, Show, w400 h400 Dialog.Instances[hGui] := this } On_Close() { MsgBox, 4, % " ", Do you want to close the window? IfMsgBox, No Return 1 Dialog.RemoveInstance(A_Gui) } On_ButtonSendAnswer() { this := Dialog.Instances[A_Gui] this.SaveStatus := True Dialog.RemoveInstance(this.hwnd) Gui, Cancel } RemoveInstance(hwnd) { Dialog.Instances.Delete(hwnd) } Wait() { dhw := A_DetectHiddenWindows DetectHiddenWindows, Off WinWaitClose, % "ahk_id " this.hwnd DetectHiddenWindows, % dhw If !this.SaveStatus Return "not saved" GuiControlGet, value,, % this.hEdit return value } __Delete() { Gui, % this.hwnd ":Destroy" } } #if

最后

以上就是自然大白最近收集整理的关于【AHK】在Obsidian中以选定日期生成链接的全部内容,更多相关【AHK】在Obsidian中以选定日期生成链接内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(95)

评论列表共有 0 条评论

立即
投稿
返回
顶部