I think we have a nice set of built-in variables that are flexible enough to do a lot of interesting things, but I keep thinking we are missing the A_Downloads variable that would point to the default location the downloads folder at in a similar fashion to A_MyDocuments!
Unless there is a technical reason preventing this, it sounds a bit better than EnvGet('SystemDrive') '\Users\' A_UserName '\Downloads'
A_Downloads might be a nice thing to have at some point.
Re: A_Downloads might be a nice thing to have at some point.
Code: Select all
; V1
RegRead, A_Downloads, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, {374DE290-123F-4565-9164-39C4925E467B}
; V2
A_Downloads := RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "{374DE290-123F-4565-9164-39C4925E467B}")
Re: A_Downloads might be a nice thing to have at some point.
or
Code: Select all
A_Downloads := ComObject('Shell.Application').NameSpace('Shell:Downloads').Self.Path
Re: A_Downloads might be a nice thing to have at some point.
yeah! those are great! i have used the one @autoexec posted before...
but hear me out: how about just A_Downloads??
That way you don't have to find those in the forums every time you need it? just type A_Downloads and you are good to go. xD
but hear me out: how about just A_Downloads??
That way you don't have to find those in the forums every time you need it? just type A_Downloads and you are good to go. xD
Projects:
AHK-ToolKit
AHK-ToolKit
- Animan8000
- Posts: 58
- Joined: 11 May 2022, 05:00
- Contact:
Re: A_Downloads might be a nice thing to have at some point.
A little unrelated, but I generally don't recommend using "A_UserName" for trying to find subfolders (downloads, pictures, etc.) of a user folder. Because A_UserName contains only the username, and not necessarily the user folder name. Depending on how Windows is installed, the script can break, if the user folder is for example shortened by Windows automatically. For example fully reinstalling Windows locally without an external drive (USB for example) did typically shorten the user folder name to only 5 characters, effectively making A_UserName pointless in this situation, and I used A_AppData instead, and went to the folder above, to avoid that inconsistencyRaptorX wrote: ↑19 Apr 2024, 17:08I think we have a nice set of built-in variables that are flexible enough to do a lot of interesting things, but I keep thinking we are missing the A_Downloads variable that would point to the default location the downloads folder at in a similar fashion to A_MyDocuments!
Unless there is a technical reason preventing this, it sounds a bit better than EnvGet('SystemDrive') '\Users\' A_UserName '\Downloads'
Re: A_Downloads might be a nice thing to have at some point.
Totally correct, I usually use the above code only on my machine for quick scripts but I totally forgot that installing the "offline" version of windows messes with the User folder for whatever reason.Animan8000 wrote: ↑24 Apr 2024, 07:22A little unrelated, but I generally don't recommend using "A_UserName" for trying to find subfolders (downloads, pictures, etc.) of a user folder. Because A_UserName contains only the username, and not necessarily the user folder name. Depending on how Windows is installed, the script can break, if the user folder is for example shortened by Windows automatically. For example fully reinstalling Windows locally without an external drive (USB for example) did typically shorten the user folder name to only 5 characters, effectively making A_UserName pointless in this situation, and I used A_AppData instead, and went to the folder above, to avoid that inconsistencyRaptorX wrote: ↑19 Apr 2024, 17:08I think we have a nice set of built-in variables that are flexible enough to do a lot of interesting things, but I keep thinking we are missing the A_Downloads variable that would point to the default location the downloads folder at in a similar fashion to A_MyDocuments!
Unless there is a technical reason preventing this, it sounds a bit better than EnvGet('SystemDrive') '\Users\' A_UserName '\Downloads'
But basically that is part of my argument, instead of having to rely on workarounds to find that folder I think it would be a nice addition to have it behave as the builtin variables for "A_AppData" or "A_MyDocuments".
The reason why I think this might not get implemented is that people can change the location of the Downloads folder (which is something I do) by going to the preferences and setting the downloads location to a new place like this:
But I would say you can do the same with "My Documents" but I am not sure how "A_MyDocuments" react to that... does it point to the new location, if it does, then I would have the same expectation for the proposed "A_Downloads".
Projects:
AHK-ToolKit
AHK-ToolKit
Who is online
Users browsing this forum: No registered users and 8 guests