Custom "Go to folder" method possible?

Discussion, questions and support.
Post Reply
Message
Author
wavemaker
Posts: 5
Joined: 17.05.2010, 16:07

Custom "Go to folder" method possible?

#1 Post by wavemaker » 17.05.2010, 16:15

Hello, there. I'm wondering if the following can be done with FreeCommander:

I have a directory structure of projects in several levels, to keep the number of projects listed together in one folder limited. Example:

...
34xxx
35xxx
-->351xx
---->3511x
------>35111 (an actual project)
------>35112 (an actual project)
------>....
---->....
-->...
...

I hope you get the idea. I wonder if it's possible with FreeCommander or with the help of a plugin, to have a textbox somewhere (preferably directly accessible), where I just enter the project number, and FreeCommander can then navigate directly to the target directory of the project.

Marek
Author
Author
Posts: 3994
Joined: 10.04.2006, 09:48
Location: Germany
Contact:

Re: Custom "Go to folder" method possible?

#2 Post by Marek » 17.05.2010, 20:49

Try to use "Flat view - folders" Ctrl+Shift+B.

wavemaker
Posts: 5
Joined: 17.05.2010, 16:07

Re: Custom "Go to folder" method possible?

#3 Post by wavemaker » 18.05.2010, 14:51

Marek, thanks, I see how I can get all folders on the same level then. However, it results in thousands of folders in the same list. FC takes close to a minute to display it. So, it's not really practical to switch to a folder in this way. It would be nice if this could somehow happen in the background when I enter a project number, which does then send me into the destination folder, but I assume that this is not possible.....or is it?

Marek
Author
Author
Posts: 3994
Joined: 10.04.2006, 09:48
Location: Germany
Contact:

Re: Custom "Go to folder" method possible?

#4 Post by Marek » 19.05.2010, 21:06

You are right, if you have many thousands folders it is unpracticable.
It would be nice if this could somehow happen in the background when I enter a project number, which does then send me into the destination folder, but I assume that this is not possible.....or is it?
Now it is not possible.

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: Custom "Go to folder" method possible?

#5 Post by BGM » 19.07.2010, 22:06

Yes there is! But you must be using Powerpro. I use this function all the time and it is wonderful. Check out Powerpro at http://powerpro.webeddie.com/

I have a script full of special functions to use with FreeCommander, but you have to have Powerpro installed. Check out my post at: http://tech.groups.yahoo.com/group/powe ... sage/37802
(you might have to have a yahoogroup account to see it...) so here is the post's text:
Hello, y'all! I just update my FC.powerpro script which provides some nice
functions for FreeCommander. You can use it to do things like getting the
current directory of the active tab; searching tabs for a particular directory;
by opening FC to a particular directory; and refreshing FC's settings. It also
has a function for creating a new text file in the currently active pane, which
also lets you set its extension, and then opens that text file automatically in
your favourite text editor for immediate editing. The old version required you
to set particular key commands within the script, but this new version will
automatically find them for you. If anyone thinks of anything else that would
be handy for this script, let me know! You can find this in the Scripts Folder.
I also use the script to check to see if any currently open tabs accessing my USB drive are open in FreeCommander so that I can then close the tabs to unlock the drive for ejection.
(Windows 10-1909 Professional 64bit)

wavemaker
Posts: 5
Joined: 17.05.2010, 16:07

Re: Custom "Go to folder" method possible?

#6 Post by wavemaker » 27.07.2010, 17:10

Hello BGM, That's interesting. I can access your message on the yahoo group, but not the files in the group (as a non-member). Where can I download your script and how do I integrate it into FC?

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: Custom "Go to folder" method possible?

#7 Post by BGM » 29.07.2010, 02:56

Hello! Well, I am glad you are interested! You can't download anything from the files folder unless you log in and join that group. If you get powerpro then you will gladly join the group - it is very helpful and you will get access to a slew of other scripts and plugins, etc. And it doesn't cost anything - Powerpro is free. Powerpro lets you create scripts that interact from the outside in (using hotkeys, window id's, etc. ) with other programs, like, say, FreeCommander. The thing about Powerpro is that it runs as a service, so you don't need lots of executable files laying around to use it, and you don't need access to a script location to run functions.
(Windows 10-1909 Professional 64bit)

W4tch3r
Posts: 10
Joined: 04.10.2007, 05:47

Re: Custom "Go to folder" method possible?

#8 Post by W4tch3r » 29.07.2010, 07:21

You could also do this using AutoIT (a general purpose scripting language for windows) and this 5 line AutoIT script:


$answer = InputBox("CD To Project Number Input Box", "Project Number")
$path = "C:\work\" & StringMid($answer,1,2) & "xxx" & "\" & StringMid($answer,1,3) & "xx" & "\" & StringMid($answer,1,4) & "x" & "\" & StringMid($answer,1,5)
Send("!g") ;Alt-G = Go To Path Dialog Box
Send($path) ;paste the constructed path
Send("{Enter}") ;Send the Enter key to FC to go to the nominated path


I've also posted the script below with comments (and some debugging lines as well).

All the required steps for you to do are:

1. Download and install AutoIT
2. Copy, paste and modify as required the below example into a text file with au3 extension (eg "GoToProjFolder.au3"). You may wish to uncomment the MsgBox calls in the script to help you tweak the path and then comment them out again when it is working.
3. Use the AutoIt compile-to-exe tools (its simple, you just right click on the au3 file in windows explorer and select "compile" - see AutoIT documentation for more info) to compile this into an exe. This is necessary as it must be called from within FC. It won't work if you try to test it from within windows explorer (by right clicking and selecting "run script")
4. Copy your new exe (eg "GoToProjFolder.exe") into your FC folder
5. Customise the FC toolbar to call your exe (if you need an icon, you can draw one with IcoFX)

A possible enhancement could be to remove the fixed $basepath from the script and make the generated path relative to the current FC active folder. To do this you would pass the current active folder into the script in step 5 above.

You might also like to try setting and locking a FC tab on the base of all your projects. When you click on any other tab and then back t this one, it will snap the tab to your project base. Very handy.

Good Luck!

W4tch3r

;--------------- CD TO FOLDER SCRIPT ------------------
; This script will only work if compiled to an exe and called from withing FreeCommander
; Generates folder path based on a 5 digit input, changes to that folder
;
; Example:
; input: 34567
; folder to which current tab is changed to: c:\work\34xxx\345xx\3456x\34567

$basepath = "C:\work\"

; Ask user for project name
$answer = InputBox("CD To Project Number Input Box", "Project Number")
;msgbox(0, "Project Number", $answer)

; Build relative path (from project name down)
$path = $basepath & StringMid($answer,1,2) & "xxx" & "\" & StringMid($answer,1,3) & "xx" & "\" & StringMid($answer,1,4) & "x" & "\" & StringMid($answer,1,5)
;msgbox(0, "Path", $path)

; Within FreeCommander, change current tab to path
;Send("^t") ;Ctrl-T Create new tab (this line is optional if you would like to open the new project in a new tab).
Send("!g") ;Alt-G = Go To Path Dialog Box
Send($path) ;paste the constructed path
Send("{Enter}") ;Send the Enter key to FC to go to the nominated path
W4tch3r ‹•¿•›

wavemaker
Posts: 5
Joined: 17.05.2010, 16:07

Re: Custom "Go to folder" method possible?

#9 Post by wavemaker » 30.07.2010, 15:10

Nice tips guys. I'll see if I can reproduce that and report back.

wavemaker
Posts: 5
Joined: 17.05.2010, 16:07

Re: Custom "Go to folder" method possible?

#10 Post by wavemaker » 06.08.2010, 15:58

Hi BGM,

I'm trying out the commands in the script. Test works fine. But most other eventually end up with an error:
Invalid use of period: cannot load plugin, invalid handle value, or invalid function: ini

Error occurred near line 169 of script FC@getFCkeys:
ini.error_dialog_off()

Called from ...
Do I understand correctly that this should refer to the ini plugin, but it cannot find this. I notice in my PowerPro49 package, the ini plugin is not present.

User avatar
BGM
Posts: 594
Joined: 14.10.2008, 23:42
Location: Kansas City, Missouri, USA
Contact:

Re: Custom "Go to folder" method possible?

#11 Post by BGM » 07.08.2010, 22:45

@wavemaker, yes, you understand correctly - you need to have the ini plugin in your pp extensions folder; the error you see is because pp is making a call to the ini plugin but can't find it; I should probably make a list of dependencies at the top of the script :)! But this is not the right forum to discuss how powerpro works! Post in the powerpro yahoo group forum and we can talk about it!
(Windows 10-1909 Professional 64bit)

Post Reply

Who is online

Users browsing this forum: No registered users and 103 guests