Option to always create directory when Synchronized Browsing

Advertisement

adam
Joined:
Posts:
5

Option to always create directory when Synchronized Browsing

Current behavior:
When synchronized browsing is turned on, and an attempt to access a remote folder not present on local. Option is given to create the directory.

[Confirm]
Do you want to try to create directory 'C:\foo\bar\'?
Cannot open corresponding directory in the opposite panel.
Directory 'C:\foo\bar' doesn't exist.
[Yes][No][Help]

Desired behavior:
Option to always choose "Yes"

The alternate behavior of always choosing "No" is already filed at https://winscp.net/tracker/631

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,266
Location:
Prague, Czechia

Re: Option to always create directory when Synchronized Browsing

Thanks for your suggestion. Will see if more people ask for this.
_________________
Martin Prikryl

Reply with quote

adam
Joined:
Posts:
5

Re: Option to always create directory when Synchronized Browsing

martin wrote:

Thanks for your suggestion. Will see if more people ask for this.

If anyone is looking for an immediate solution, you can hack a solution with open source AutoHotKey.

Just create a text file with extension .ahk and run with portable AutoHotKey
Following code runs an infinite loop
Note the window title and ahk_class used within the program are not unique to WinSCP so every 10 minutes loop checks whether WinSCP window is still open
; Program: WinSCP 
; Issue: Sychronized Browsing - Always "Yes"
; Workaround: 
;   1. Wait for WinSCP commander interface window to exist
;   2. Wait for confirmation prompt for creating local folder 
;   3. "Click" Yes

DetectHiddenText, off  ;will not search hidden window text (faster)
DetectHiddenWindows, off  ;will not detect hidden windows (faster)

Loop {  ;continue indefinitely

; WinWait* is event-driven hook implementation consuming 0% cpu while process is stored in RAM
; WinTitle=Confirm AND ahk_class=TMessageForm AND Text=&Yes is not unique to WinSCP, so minimize interference by at least wait indefinitely until WinSCP Commander window exists
WinWait, ahk_class TScpCommanderForm  

; Wait until confirm prompt window exists and has focus where WinTitle=Confirm and ahk_class=TMessageForm
; Every 10 minutes checks if WinSCP Commander GUI is still running
WinWaitActive, Confirm ahk_class TMessageForm, &Yes, 600  

; Default answer is Y, therefore "Send {Enter}" would work, also "Send y"
; For accuracy, we will press specific mapped button of matched window in case focus was lost (such as may happen with mouseover-focus and zero focus-delay)
; TMessageButton3=&Yes TMessageButton2=&No TMessageButton1=&Help
ControlSend, TMessageButton3, {Enter}, ahk_class TMessageForm  
}
}

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,266
Location:
Prague, Czechia

Re: Option to always create directory when Synchronized Browsing

Thanks for sharing your solution!
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum