Open directly subfolder if folder is empty (recursively)

Suggestions and feature requests.
Post Reply
Message
Author
Uzanto de FCOMM
Posts: 10
Joined: 21.11.2011, 10:48

Open directly subfolder if folder is empty (recursively)

#1 Post by Uzanto de FCOMM » 29.04.2016, 13:12

Hello Marek and all others,
one feature i need when i work with Java projects is the possibility to go to the first not-empty subfolder when i open an empty folder.
This would save a lot of clicks.

E.g. In Java projects (but not only Java...) I have often the following situation:
C:\workspace\project1\emptyFolder1\emptyFolder2\emptyFolder3\emptyFolder4\FolderWithFiles\Main.java

Where, as the name suggests, the emptyFolderX are folders without files, needed just to create the project structure (often the name of emptyFolder1 is "src").
Now, it would be nice if an option would allow to click on emptyFolder1 and freeCommander would automatically open all the subfolders untill he reaches:
C:\workspace\project1\emptyFolder1\emptyFolder2\emptyFolder3\emptyFolder4\FolderWithFiles\

In this situation, if user wants to go on emptyFolder3, (s)he can click on the clickable address and will reach it quite easily.
But in most of the cases, user wants to arrive to FolderWithFiles without too many clicks.

Developement tools often offer this possibility (some, as Eclipse can even group the empty folders, but in case of freeCommander this would be too much).

afh
Posts: 87
Joined: 30.06.2014, 18:50
Location: Romania

Re: Open directly subfolder if folder is empty (recursively)

#2 Post by afh » 30.04.2016, 06:43

I would suggest SHIFT+CRTL+B and then ALT+F9.
In plain view - folder, an folder that has no files (but have subfolders) has 0 size.
Also add "Path" column to details (to see the path and sort).

Uzanto de FCOMM
Posts: 10
Joined: 21.11.2011, 10:48

Re: Open directly subfolder if folder is empty (recursively)

#3 Post by Uzanto de FCOMM » 02.05.2016, 07:56

afh wrote:I would suggest...
Good workaround, I will use for sure, but still a workaround...

afh
Posts: 87
Joined: 30.06.2014, 18:50
Location: Romania

Re: Open directly subfolder if folder is empty (recursively)

#4 Post by afh » 02.05.2016, 18:46

All you can do is to write an exe that takes %ActivSel% as cmdline parameter and then starts Freecommander.exe with /C parameter -> see http://www.freecommander.com/fchelpxe/e ... eters.html

Here is an autoit script that should do that (at least I hope... :) I'm not an expert...)
You need of course to compile the script and use the exe file.

Code: Select all

If $cmdline[0] = 0 Then Exit
$folder = $cmdline[1]
recursive($folder)
MsgBox(0,"", "No folder with files found")
Func recursive($path)
$search = FileFindFirstFile($path & "\*")
$subfolderName = ""
While 1
	$file = FileFindNextFile($search)
	If @error then	ExitLoop
	If Not @extended Then
		$cmd = "C:\PortableApps\FreeCommanderXE_HOME\FreeCommander.exe /C /L=""" & $path & """"
		Run('"' & @ComSpec & '" /c "' & $cmd & '"' , '', @SW_HIDE)
		Exit
	Else
;~ 	keep folder names for later
	$subfolderName &= $file & "|"
	EndIf
WEnd
	FileClose($search)
        If $subfolderName = "" then Return
	$name = StringSplit(StringTrimRight($subfolderName,1), "|")
	For $i = 1 to $name[0]
		recursive($path & "\" & $name[$i])
	Next
EndFunc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests