Code: Select all
::-d::
FormatTime, CurrentDateTime,, yy-MM-dd
SendInput %CurrentDateTime%
Send {Space}
return
Code: Select all
::-d::
FormatTime, CurrentDateTime,, yy-MM-dd
SendInput %CurrentDateTime%
Send {Space}
return
I did read the documentation, but not sure how I can get the file path directly while I'm in windows explorer with the file highlighted?
Code: Select all
FileGetTime, OutputVar, C:\My Documents\test.doc, C ; Retrieves the creation time.
Code: Select all
C:\My Documents\test.doc
Code: Select all
F3::
For itemNum, item in Explorer_GetSelection()
FileGetTime, ctime, %item%, C
Clipboard =
FormatTime, Clipboard, %ctime%, yy-MM-dd
ClipWait
If ErrorLevel
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
Else MsgBox,, Copied to clipboard, % Clipboard "`n`n(For " RegExReplace(item, ".+\\") ")"
Return
Explorer_GetSelection() {
; https://www.autohotkey.com/boards/viewtopic.php?style=17&t=60403#p255256
WinGetClass, winClass, % "ahk_id" hWnd := WinExist("A")
If !(winClass ~= "Progman|WorkerW|(Cabinet|Explore)WClass")
Return
shellWindows := ComObjCreate("Shell.Application").Windows, sel := []
If !(winClass ~= "Progman|WorkerW") {
For window in shellWindows
If (hWnd = window.HWND) && (shellFolderView := window.Document)
Break
} Else shellFolderView := shellWindows.FindWindowSW(0, 0, SWC_DESKTOP := 8, 0, SWFO_NEEDDISPATCH := 1).Document
For item in shellFolderView.SelectedItems
sel.Push(item.Path)
Return sel
}
Code: Select all
If (window.HWND && hWnd = window.HWND && shellFolderView := window.Document)
Afaik, this is actually done by AHK internally at script start - and shouldn't be a problem.
Users browsing this forum: CastleChou, Google [Bot], jaka1 and 133 guests