Created
July 4, 2020 11:31
-
-
Save emisjerry/39e3dee49b4237267d12d45244991187 to your computer and use it in GitHub Desktop.
AutoHotkey Scripts for obsidian.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Scripts for obsidian.md | |
;; http://jdev.tw/blog | |
;; v0.1 2020/07/02 jerry | |
#SingleInstance Force | |
:O*:d0:: | |
;; 0409 language code for USA | |
FormatTime, vToday,L0x0409, yyyy-MM-dd_ddd | |
send [[%vToday%]] | |
return | |
:O*:d+1:: | |
sendDate(1) | |
return | |
:O*:d+2:: | |
sendDate(2) | |
return | |
:O*:d-1:: | |
sendDate(-1) | |
return | |
:O*:d-2:: | |
sendDate(-2) | |
return | |
; 由Obsidian網站找到的腳本,我做了點小修改,以產生USA格式 | |
; Date picker | |
defaultdate := %A_YYYY%%A_MM%%A_DD% | |
^q:: | |
Gui, Add, Text, x10 y15 w60 h20, StartDate: | |
Gui, Add, DateTime, x+10 y10 wp20 h20 vStartDate Choose%defaultdate% Section, | |
Gui, Add, Text, x10 y55 w70 h20 , StartTime: | |
Gui, Add, DateTime, x+10 y50 wp hp vStartTime Choose%defaultdate%000000 1, HH:mm ;time | |
Gui, Add, Button, x10 y90 w60 h20 Default, &OK | |
Gui, Show, w220 h130, AHK-Scheduler | |
Return | |
ButtonOK: | |
Gui, submit, Hide | |
defaultdate = %StartDate% | |
FormatTime, StartDate, %StartDate% L0x0409, yyyy-MM-dd_ddd | |
Send [[%StartDate%]] | |
Gui, Destroy | |
return | |
GuiClose: | |
Gui Destroy | |
return | |
GuiEscape: | |
Gui Destroy | |
return | |
sendDate(iDay) { | |
;; 0409 language code for USA | |
iDate := A_Now | |
;; iToday += 1, Days | |
EnvAdd, iDate, %iDay%, Days | |
FormatTime, iDate,%iDate% L0x0409, yyyy-MM-dd_ddd | |
send [[%iDate%]] | |
return iDate | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment