Hello...
I was wondering if one would know of a way on how I'd be able to have a «executed via shortcut-icon's "recent launched AHKs" quick access context-menu» (similar to shown in picture).
Or, even better, to know how I could create a .ahk filetype's new context-menu "custom sub-menu entry" that would display a "total x-amount of recent-executed scripts".
Any help would be greatly appreciated.
Thanks.
(Note: included in screenshot is Windows 10's taskbar with a OpenShell-set theme).
Have a "Recent .ahk" quick access menu...
Have a "Recent .ahk" quick access menu...
- Attachments
-
- AHK, Shortcut-Icon's ''Context-Menu Inquiry'' 46.875.png (86.77 KiB) Viewed 378 times
Re: Have a "Recent .ahk" quick access menu...
Just ideas here: you could have your scripts log themselves somewhere, or use the Windows Recent directory to find the script links.
Re: Have a "Recent .ahk" quick access menu...
I was thinking about Windows recent directory while writing this... the classic one located in %APPDATA%\Microsoft\Windows\Recent Items
(I'll have to do a quick search on how to extend said-directory to exceed 7 days)
Although, if not too much trouble, would you be able to point me to the proper direction of/or show a quick example of how I'd proceed to script something that...
‒ can read a folder's contained item of a specified directory-path of preference.
‒ while only reading file-extensions of preference.
‒ as-well as to only be reading .ahk files starting from a specified timestamp of preference?
And, if still not too much trouble,
How to do so via using read-preferences from an either a .xml or from a .ini file-extension?
I'd use certain variables such as:
‒ SelectDir = %AppData%\Microsoft\Windows\Recent Items
‒ SelectExt = ahk {using commas to include additional file-extensions}
‒ StartTime = 2023-08-01
‒ EndTime = {date entry, or, leaving blank would mean up to now}
(I'll have to do a quick search on how to extend said-directory to exceed 7 days)
Although, if not too much trouble, would you be able to point me to the proper direction of/or show a quick example of how I'd proceed to script something that...
‒ can read a folder's contained item of a specified directory-path of preference.
‒ while only reading file-extensions of preference.
‒ as-well as to only be reading .ahk files starting from a specified timestamp of preference?
And, if still not too much trouble,
How to do so via using read-preferences from an either a .xml or from a .ini file-extension?
I'd use certain variables such as:
‒ SelectDir = %AppData%\Microsoft\Windows\Recent Items
‒ SelectExt = ahk {using commas to include additional file-extensions}
‒ StartTime = 2023-08-01
‒ EndTime = {date entry, or, leaving blank would mean up to now}
Re: Have a "Recent .ahk" quick access menu...
Ideas to get you started are below. "Recent" can indicate various forms of file access, not limited to execution.
Code: Select all
#Requires AutoHotkey v1.1.33
#SingleInstance
recent := A_AppData "\Microsoft\Windows\Recent"
scriptList := []
; Identify recently accessed scripts
Loop Files, % recent "\*.lnk" ; Loop through the recent LNK files
{ FileGetShortcut % A_LoopFilePath, target ; Get the link's target path
If FileExist(target) && target ~= "i)\.ahk$" ; If target is an AHK script,
scriptList.Push(target) ; then add to array
}
; Display script's path and last access time
For n, script in scriptList ; Loop through array's elements
If FileExist(script) {
FileGetTime accessTime, % script, A ; Get the script's last access time
FormatTime accessTimeTxt, % accessTime, yyyy-MM-dd 'at' HH:mm
MsgBox 0, % "Recent script (" n " of " scriptList.Length() ")", % script "`n`nAccessed: " accessTimeTxt
}
Who is online
Users browsing this forum: AlFlo, Bing [Bot], Google [Bot] and 141 guests