AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Folder Menu - a popup menu to quickly change your folders
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
comvox



Joined: 20 May 2009
Posts: 14

PostPosted: Sat May 30, 2009 11:11 pm    Post subject: Reply with quote

Thank you rexx for this excellent script (and Savage for the script that was its original base). If this script simply allowed selecting the appropriate folder in various situations, it would be really useful. But it's also a convenient launcher. It's my favorite autohotkey script, aside from some very simple scripts I wrote for myself.

A question:

This script has the feature of, under certain conditions, opening folders in Windows Explorer. Would it possible to modify it to have it open folders in Total Commander instead? I was thinking that this might only require a modification of a few lines, but my understanding of autohotkey is quite primitive, and I couldn't figure out how to do this by myself. On the other hand, if it requires more than simply modifiying a few lines, then it probably isn't worth doing, as I can, of course, get most of what I want by opening Total Commander first, and then Folder Menu manipulates it.
Back to top
View user's profile Send private message
rexx



Joined: 28 Feb 2006
Posts: 72

PostPosted: Sun May 31, 2009 4:24 am    Post subject: Reply with quote

comvox wrote:
Thank you rexx for this excellent script (and Savage for the script that was its original base). If this script simply allowed selecting the appropriate folder in various situations, it would be really useful. But it's also a convenient launcher. It's my favorite autohotkey script, aside from some very simple scripts I wrote for myself.

Thank you!

comvox wrote:

This script has the feature of, under certain conditions, opening folders in Windows Explorer. Would it possible to modify it to have it open folders in Total Commander instead? I was thinking that this might only require a modification of a few lines, but my understanding of autohotkey is quite primitive, and I couldn't figure out how to do this by myself. On the other hand, if it requires more than simply modifiying a few lines, then it probably isn't worth doing, as I can, of course, get most of what I want by opening Total Commander first, and then Folder Menu manipulates it.

Find "Run, explore " in FolderMenu.ahk, it's where it opens a new explorer and explore to a folder.
Modify it to something like "Run, C:\totalcmd\totalcmd.exe ", then it will open the folder in total commander(i think).
Back to top
View user's profile Send private message
comvox



Joined: 20 May 2009
Posts: 14

PostPosted: Sun May 31, 2009 8:29 pm    Post subject: Reply with quote

Quote:
Find "Run, explore " in FolderMenu.ahk, it's where it opens a new explorer and explore to a folder.
Modify it to something like "Run, C:\totalcmd\totalcmd.exe ", then it will open the folder in total commander(i think).


Thank you, Rexx. This looks promising. Following this idea I modified two places in the script. At first, it seemed to work perfectly, and I was happily modifying totalcmd command line parameters. Then I noticed some problems.

(a) Some folders opened to where they should, and some didn't. This puzzled me until I realized that the issue was blank spaces in the path. Total Commander insists that if a path which is being used as a command line parameter has blank spaces, one has to put quotes around the path. So all I had to do to solve this issue was replace %ThisPath% with "%ThisPath%" and %SelectedPath% with "%SelectedPath%".

(b) Another problem is that the resulting script, instead of launching applications like UsefulScript.ahk or KeyNote.exe (for brevity, I am leaving out the full path to UsefulScript.ahk or KeyNote.exe or TotalCmd.exe), now simply opened up to the folder the particular application was in. This was puzzling. It turns out it has to do with the fact that, in the original script,

Run, explore, %ThisPath%,,UseErrorLevel

will reject %ThisPath% and set the ErrorLevel
if %ThisPath% is UsefulScript.ahk or KeyNote.exe,
and the script then goes on eventually to

Run, %ThisPath%,,UseErrorLevel, which launches the application,

but in the modified script
Run, TotalCmd, "%ThisPath%,,UseErrorLevel will blithely go to the folder which the application is in.

I have not yet figured out how to deal with this. I think what I will have to do is have %ThisPath% tested to see if it ends in .ahk or .exe or .com or .htm or .html. The result of this test will then determine whether the script goes on to

Run, TotalCmd "%ThisPath%",,UseErrorLevel

or goes to

Run, %ThisPath%,,UseErrorLevel.

I might not get to this today, but I'll post when I either write some appropriate code or give up and ask for help!
Back to top
View user's profile Send private message
comvox



Joined: 20 May 2009
Posts: 14

PostPosted: Mon Jun 01, 2009 1:17 am    Post subject: Reply with quote

OK. I think I've found suitable code to deal with the problem I mentioned in my last post, although I've have to test it more.

One replaces

Code:
   if w_Edit1Pos =
   {
         Run, P:\TotalCmd\TotalCmd.exe /o "%ThisPath%", , UseErrorLevel
        if ErrorLevel
      {
         Run, %ThisPath%, , UseErrorLevel
         if ErrorLevel
         TrayTip, Error, Could not open`n`"%ThisPath%`"`nThere's something wrong with your config file., , 3
      }
   }
   else


with


Code:
   if w_Edit1Pos =
   {
        StringRight, ThisExt, ThisPath, 4
     if ThisExt in .exe,.bat,.com,.ahk,.htm,html
                          {
      Run, %ThisPath%, , UseErrorLevel
      if ErrorLevel
      TrayTip, Error, Could not open`n`"%ThisPath%`"`nThere's something wrong with your config file., , 3
                           }
                          else
                           {
        Run, P:\TotalCmd\TotalCmd.exe /o "%ThisPath%", , UseErrorLevel
      if ErrorLevel
      TrayTip, Error, Could not open`n`"%ThisPath%`"`nThere's something wrong., , 3
                            }
                         }   
   else


One does a similar replacement at the other place in the script where
Run, TotalCmd appears.

(The /o is simply a Total Commander command line parameter which could be used, dropped, or replaced with others depending on preference.)

This seems to work well. But besides testing it more, I have to consider what should be in the list of extensions, and also probably improve the error messages to something more fitted to the modified code.

Wow, I'm pretty clumsy at this and have only figured out a little bit about scripting, but I was surprised when doing the above that autohotkey does make doing things like checking extensions pretty easy. Still, I couldn't use autohotkey at all if it weren't for this forum. For some reason, autohotkey seems to do things differently from what I expect, and it takes me a lot of looking at what other people do and discuss to figure things out.
Back to top
View user's profile Send private message
rexx



Joined: 28 Feb 2006
Posts: 72

PostPosted: Mon Jun 01, 2009 2:37 am    Post subject: Reply with quote

You can use
Code:
if InStr(FileExist(ThisPath), "D")

to check if ThisPath is a folder.
you can look FileExist() in the ahk document for more details.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Jun 01, 2009 3:57 am    Post subject: Reply with quote

Very nice script. Together with Windowpad the best script!!!
Back to top
comvox



Joined: 20 May 2009
Posts: 14

PostPosted: Tue Jun 02, 2009 4:16 am    Post subject: Reply with quote

Quote:
You can use Code:

Code:
if InStr(FileExist(ThisPath), "D")


to check if ThisPath is a folder.
you can look FileExist() in the ahk document for more details.


Thanks Rexx. That is a bit simpler than checking the extension.

Oh, one additional thing. With modifying the script at two points, the script -- if it's run while in Total Commander via the hotkey for Show Menu 1 -- still changes the folder rather than launching an application. That's not really that important, since one is now in the correct folder and can just double-click the application to start it. But one could correct it by replacing

Code:
      ; Total Commander (thanks to FatZgrED)
      else if w_Class = TTOTAL_CMD
           {
         ;Total Commander has Edit1 control but you need to cd to location
                    ControlSetText, Edit1, cd %ThisPath%, ahk_id %w_WinID%
                    ControlSend, Edit1, {Enter}, ahk_id %w_WinID%
            }


with

Code:
      ; Total Commander (thanks to FatZgrED)
      else if w_Class = TTOTAL_CMD
                          {
         ;Total Commander has Edit1 control but you need to cd to location

                   if InStr(FileExist(ThisPath), "D")
                    {
                    ControlSetText, Edit1, cd %ThisPath%, ahk_id %w_WinID%
           ControlSend, Edit1, {Enter}, ahk_id %w_WinID%
                     }
                      Else
                      {
                      Run, %ThisPath%, , UseErrorLevel
                      if ErrorLevel
                      TrayTip, Error, Some problem with Run the path, , 3
                         }                                                                       
                                                                   
                     }


So there are three places to modify in the script to obtain the full effect I was looking for, not two, although this last place isn't really that important.

Finally, having done all this, it makes Folder Menu even more convenient for me. So thank you again for this script, rexx.
Back to top
View user's profile Send private message
sms
Guest





PostPosted: Wed Jun 10, 2009 8:38 am    Post subject: Reply with quote

Rexx, thanks for this great script.

In xplorer˛ Lite it writes the new folder in the correct place (adress bar). But the {Enter} goes to the folder pane. So it starts the first file entry. Is there a solution?
Back to top
rexx



Joined: 28 Feb 2006
Posts: 72

PostPosted: Sun Jun 14, 2009 4:38 am    Post subject: Reply with quote

sms wrote:
Rexx, thanks for this great script.

In xplorer˛ Lite it writes the new folder in the correct place (adress bar). But the {Enter} goes to the folder pane. So it starts the first file entry. Is there a solution?

Fixed this.
Try it again in the next version (2.02).
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Jun 15, 2009 3:48 am    Post subject: Reply with quote

This is the greatest script ever (together with windowpad)!

THANK YOU!
Back to top
winflowers



Joined: 21 Feb 2005
Posts: 11

PostPosted: Mon Jun 15, 2009 8:48 am    Post subject: Reply with quote

I just started to use Folder Menu several days ago, and love it so much. But I face some problems with the new version 2.02.
I use Unreal Commander as my File Manager, and it works well with Folder Menu 2.01. However, when I want to go to a favorite folder in 2.02, for example d:\tools, then the Unreal Commander shows a message:
Code:
A directory with the name
d:\tools
already exists. Do you want to move the file/dir to this subdirectory?

Nothing happens when I click either YES or NO buttons.

Could you please find out what changes cause the problems and fix it? Thank you very much!
I use Unreal Commander v0.95. It is a free software.
Back to top
View user's profile Send private message
winflowers



Joined: 21 Feb 2005
Posts: 11

PostPosted: Mon Jun 15, 2009 9:34 am    Post subject: Reply with quote

winflowers wrote:
I just started to use Folder Menu several days ago, and love it so much. But I face some problems with the new version 2.02.
I use Unreal Commander as my File Manager, and it works well with Folder Menu 2.01. However, when I want to go to a favorite folder in 2.02, for example d:\tools, then the Unreal Commander shows a message:
Code:
A directory with the name
d:\tools
already exists. Do you want to move the file/dir to this subdirectory?

Nothing happens when I click either YES or NO buttons.

Could you please find out what changes cause the problems and fix it? Thank you very much!
I use Unreal Commander v0.95. It is a free software.


Sorry. It seems working again after I delete the configuration file and restart Folder Menu.
Back to top
View user's profile Send private message
praetor



Joined: 27 May 2009
Posts: 4

PostPosted: Tue Jun 16, 2009 8:08 pm    Post subject: Reply with quote

I don't understand how works "favorite folder from Total Commander". Please can you help me?

Thanks
Back to top
View user's profile Send private message
rexx



Joined: 28 Feb 2006
Posts: 72

PostPosted: Wed Jun 17, 2009 4:28 am    Post subject: Reply with quote

praetor wrote:
I don't understand how works "favorite folder from Total Commander". Please can you help me?

Thanks

Click mouse middle button in total commander, and select "Folder Menu" > "Add Favorite", then the current folder will be added to favorite.
Back to top
View user's profile Send private message
praetor



Joined: 27 May 2009
Posts: 4

PostPosted: Wed Jun 17, 2009 11:12 am    Post subject: Reply with quote

Quote:
Click mouse middle button in total commander, and select "Folder Menu" > "Add Favorite", then the current folder will be added to favorite.

Thank you, now I understand. I thought, it works now with the Total Commander directory menu. Is that feature comming soon?

Best wishes
praetor
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 10, 11, 12  Next
Page 6 of 12

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group