Update to this script to copy filepaths?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JohnTravolski
Posts: 21
Joined: 22 Dec 2015, 15:10

Update to this script to copy filepaths?

03 Sep 2021, 11:16

I have been using this script here for a while to copy the filepath of selected items in File Explorer and it has been working great. However, it does not work when I am inside of a program using a "Save As" dialog. For example, if I am in Excel and go to "Save As," a file explorer dialog pops up to select a file. But if I have anything selected in there and run the hotkey, it just copied "Error" to clipboard.
image.png
image.png (46.36 KiB) Viewed 183 times
From what I can tell, this is because the process is condiered "Excel.exe" rather than "explorer.exe" as the script explicitly looks for. But I still get errors when I remove that check, so I think the rest of the code would have to differ somehow, but I'm not sure how.

Does anybody know how to update this script to work for file selection dialog boxes?
User avatar
mikeyww
Posts: 27261
Joined: 09 Sep 2014, 18:38

Re: Update to this script to copy filepaths?

03 Sep 2021, 12:39

At least for the top bar:

Code: Select all

ControlGetText, ThisPath, ToolbarWindow325, ahk_class #32770

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], peter_ahk and 196 guests