AutoHotkey Community

It is currently May 26th, 2012, 6:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 13  Next
Author Message
 Post subject:
PostPosted: May 30th, 2009, 11:11 pm 
Offline

Joined: May 20th, 2009, 6:18 pm
Posts: 129
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 4:24 am 
Offline

Joined: February 28th, 2006, 4:38 pm
Posts: 73
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).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 8:29 pm 
Offline

Joined: May 20th, 2009, 6:18 pm
Posts: 129
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2009, 1:17 am 
Offline

Joined: May 20th, 2009, 6:18 pm
Posts: 129
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2009, 2:37 am 
Offline

Joined: February 28th, 2006, 4:38 pm
Posts: 73
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2009, 3:57 am 
Very nice script. Together with Windowpad the best script!!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 2nd, 2009, 4:16 am 
Offline

Joined: May 20th, 2009, 6:18 pm
Posts: 129
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2009, 8:38 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 4:38 am 
Offline

Joined: February 28th, 2006, 4:38 pm
Posts: 73
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).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2009, 3:48 am 
This is the greatest script ever (together with windowpad)!

THANK YOU!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2009, 8:48 am 
Offline

Joined: February 21st, 2005, 9:07 am
Posts: 11
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2009, 9:34 am 
Offline

Joined: February 21st, 2005, 9:07 am
Posts: 11
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 16th, 2009, 8:08 pm 
Offline

Joined: May 27th, 2009, 6:54 pm
Posts: 4
I don't understand how works "favorite folder from Total Commander". Please can you help me?

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2009, 4:28 am 
Offline

Joined: February 28th, 2006, 4:38 pm
Posts: 73
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 17th, 2009, 11:12 am 
Offline

Joined: May 27th, 2009, 6:54 pm
Posts: 4
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 181 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 13  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Google [Bot], Google Feedfetcher, Jaaaaaaaaay and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group