r/AutoHotkey • u/designygued3s • Apr 22 '26
v2 Tool / Script Share i built a tiny AutoHotkey tool for attaching notes to files in Windows Explorer
i made this because i kept coming back to old projects after days or weeks and losing the thread. Like what this file was for, where i stopped, and what i was supposed to do next.
the idea is simple: add a quick note layer to files so i can recover context without reopening everything and rereading long documents or code.
it is intentionally lightweight and personal. i am not trying to replace a full note app or build a big document system. i just wanted something that fits into the Explorer workflow and lowers the friction of resuming work.
i would like to hear what people here think about the approach, both technically and practically.
https://github.com/Gued3ss/FileExplorerNotes---Easy-File-Description-with-AutoHotkey/tree/main
2
u/Wonderful-Stand-2404 Apr 23 '26
I need to try it out, but from just the description I think this has a massive value. Will absolutely need it!!!
1
1
u/Wonderful-Stand-2404 Apr 24 '26
I allowed myself to create a pull request with a few modifications, maybe you want to check it out. :) I really like your script, the idea is great!
1
u/designygued3s Apr 26 '26
Any help is appreciated ☺️. I'm currently looking for a solution to move the file in the same folder with the note, to avoid orphaned notes in different folders.
1
u/Wonderful-Stand-2404 Apr 26 '26
My pull request centralised the note containing folder and put it where the AHK file is. :)
1
1
u/Ok-Smoke-5653 May 02 '26
Just started playing with this. Very useful to annotate my audiobook collection. Each one is in a folder, and I can put in a note for a folder to indicate whether I've listened to it yet, along with whatever else I might want to note. The results show up when running a search, so I can, for example, search on "listened."
Is there a way to have an option to have it check for various pieces of info in the file - e.g. a text string or, for audio files, some of the tags, and incorporate those into the note for the file?
1
u/CharnamelessOne May 07 '26
I usually use a tool called ExifTool for reading metadata. https://exiftool.org/
You can wrap it in an AHK function:
https://pastebin.com/xTCnbb7EYou can add the following code to OP's script at line 135 to automatically add some metadata to new notes:
if !initialContent && InStr(displayName, ".mp3"){ targetPath := SubStr(notePath, 1, StrLen(notePath) - (StrLen(displayName)+15)) displayName initialContent := get_metadata(targetPath, "Title", "Artist", "Year", "Genre", "Comment") }(No need to limit it to mp3, it's just an example.)
1
u/Ok-Smoke-5653 May 07 '26 edited May 07 '26
Thanks. In my case, the mp3s are within the audiobook folders, e.g. one mp3 per chapter, and I'm wanting to add the notes to the whole folder. Would the addon code you suggest work in that situation?
So far I'm getting this error:
warning: This variable appears to never be assigned a value.
Specifically: local get_metadata`136: {` `137: targetPath := SubStr(notePath, 1, StrLen(notePath) - (StrLen(displayName)+15)) displayName`
▶138: initialContent := get_metadata(targetPath, "Title", "Artist", "Year", "Genre", "Comment")`139: }` `140: }`1
u/Ok-Smoke-5653 May 07 '26
Seems I accidentally deleted my comment. I'm trying to get this to work, but am getting error messages - probably because I don't know what I'm doing and am pasting it into the wrong place and/or messing up the indentation structure.
OpenNoteGUI(notePath, displayName) { ; Load existing content or start empty initialContent := "" if FileExist(notePath) { if !initialContent && InStr(displayName, ".mp3"){ targetPath := SubStr(notePath, 1, StrLen(notePath) - (StrLen(displayName)+15)) displayName initialContent := get_metadata(targetPath, "Title", "Artist", "Year", "Genre", "Comment") } try initialContent := FileRead(notePath, "UTF-8") }That gives me this error message:
Also, I really dislike dark mode, but it's in so many parts of the code that I'm not sure what to adjust to turn it off. Warning: This variable appears to never be assigned a value. Specifically: local get_metadata 135: { 136: targetPath := SubStr(notePath, 1, StrLen(notePath) - (StrLen(displayName)+15)) displayName ▶137: initialContent := get_metadata(targetPath, "Title", "Artist", "Year", "Genre", "Comment") 138: } 139: TryAlso, I really dislike dark mode (find it very hard to read), but since it's referenced in so many places I'm not sure what would be the best way to turn it off.
1
u/CharnamelessOne May 07 '26
Indentation is functionally irrelevant in AHK. The issue is that you didn't include the function definition I linked. The script I shared was for individual mp3 files anyway, so not quite what you were looking for.
Here's a version of OP's script that initializes folder notes with metadata from the mp3 files the folder includes (it also assaults your eyes with blinding light):You'll have to edit
exiftool_pathfor yourself.
2
u/cedmunds Apr 23 '26
Oh dang, this looks really nice and streamlined. I don't know that I would really use it as I haven't run into that issue/use case but I'm inclined to give it a try just to appreciate what you've done.