Last active
November 26, 2021 19:52
-
-
Save davebrny/fd31caabaa02a3e7e60095011e97b783 to your computer and use it in GitHub Desktop.
(autohotkey) - open properties for the selected file (and use "run" if the hotkey didnt send)
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
#ifWinActive ahk_class CabinetWClass | |
^+p::goSub, file_properties | |
#ifWinActive | |
file_properties: | |
revert_clipboard := clipboardAll | |
clipboard = | |
send ^{c} | |
clipWait, 0.6 | |
selected_file := clipboard | |
clipboard := revert_clipboard | |
if (selected_file = "") | |
trayTip, file properties, clipWait timed out. try again, 8 | |
else | |
{ | |
send !{enter} ; default properties hotkey | |
splitPath, selected_file, filename | |
winWaitActive, % filename " Properties ahk_class #32770", , 0.5 | |
if (errorLevel = 1) ; if !{enter} didnt open any properties | |
and !inStr(selected_file, "`n") ; and only a single file was selected | |
run, properties "%selected_file%" | |
} | |
return | |
/* | |
[script info] | |
version = 1.1 | |
description = open properties for the selected file (and use "run" if the hotkey didnt send) | |
author = davebrny | |
source = https://gist.github.com/davebrny/fd31caabaa02a3e7e60095011e97b783 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello again @davebrny. I've done several tests and the problem didn't appear again. That was weird the first time, didn't understand why would something like that even happen - some sort of loop, yes, but how? :)
While testing I noticed just one thing: the script doesn't seem to work for desktop files or folders. Tested in several places and on several file extensions, including repeatedly on file_properties.ahk, nothing "bad" happened anymore, but on desktop it just won't work. :)
Anyway, thanks very much for this script and the rest of them, some are sooo, sooo helpful!