Change "Save As" Location ?

Get help with using AutoHotkey and its commands and hotkeys
scriptor2016
Posts: 538
Joined: 21 Dec 2015, 02:34

Change "Save As" Location ?

21 Jul 2019, 00:40

Hi

I've searched for what I thought might be an easy topic, but so far I haven't found much on it.

for example:

When you right-click on an image from the internet and select "save as", it brings up the windows "Save As" dialog, and its class is ahk_class #32770

I'm looking for a way to just maybe just create a GUI which has a listview of pre-defined folder locations and when any of these locations are clicked on (while the "Save As" dialog is active), then it will direct the "Save As" window to that folder location.

I thought I might have had some code to do this, but so far no dice.

Can anyone point in the right direction?

Thank you!!!!
vsub
Posts: 181
Joined: 29 Sep 2015, 03:39

Re: Change "Save As" Location ?

21 Jul 2019, 03:17

Place the paths you want in the SaveAs variable and right click on the Save button while that window is active to get a list of locations to save.
Once you click on the location from the menu,ahk will send the path and the name you type in the edit control and save the file

You can also add a separator by adding | into the SaveAs variable

Code: Select all

SaveAs =
(
C:\
C:\New Folder\
|
D:\Files\
X:\1\
)

Loop,Parse,SaveAs,`n
{
If A_LoopField =
Break
If A_LoopField = |
Menu, Menu, Add,
Else
Menu,Menu,Add,% A_LoopField,Handler
}

#IfWinActive,Save As AHK_class #32770
~RButton::
Keywait,RButton
MouseGetPos,,,Window,Control,2
ControlGetText,Save,,Ahk_ID %Control%
If Save != &Save
Return
Else
Menu,Menu,Show
Return

#If

Handler:
WinActivate,AHK_ID %Window%
ControlGetText,Name,Edit1,AHK_ID %Window%
IfNotExist,% A_ThisMenuItem
FileCreateDir,% A_ThisMenuItem 
If ( SubStr(A_ThisMenuItem,0,1) != "\" )
ControlSetText,Edit1,% A_ThisMenuItem "\" Name,AHK_ID %Window%
Else
ControlSetText,Edit1,% A_ThisMenuItem  Name,AHK_ID %Window%
Send,{Enter}
Return
scriptor2016
Posts: 538
Joined: 21 Dec 2015, 02:34

Re: Change "Save As" Location ?

21 Jul 2019, 03:29

now THAT is cool!!! working perfect... I will play around with this idea!!! thanks for this :) :)

Return to “Ask For Help”

Who is online

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