This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ButtonBar eXtended (with macro support)
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Wed Sep 17, 2008 9:03 am    Post subject: ButtonBar eXtended (with macro support) Reply with quote

ButtonBar eXtended for Total Commander


Download:

ButtonBar eXtended 2.3
ButtonBar eXtended readme
ButtonBar eXtended source (AHK)


Video:

Watch the video to see how it works:
ButtonBar eXtended video

For further informations read the readme.


Very important:

Please, please, please read the readme to get informations about installation, usage and the last changes.
Its useful - trust me. Very Happy


Features:
  • Create buttons that run macros (of TC commands and/or program calls)
  • Buttons can run different commands if you hold down modifier keys like Ctrl, Alt and Shift. Its also possibly to use mouse buttons as modifiers.
  • Integration into TCs buttonbar.

Suggestions are welcome.
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de


Last edited by Samuel on Wed Mar 21, 2012 12:14 pm; edited 20 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TRSyntax
Junior Member
Junior Member


Joined: 21 Apr 2008
Posts: 57

PostPosted: Thu Sep 18, 2008 3:41 am    Post subject: Reply with quote

I can use this Very Happy makes things even more simple. c",)

Quote:
[Button 2 Normal]
1_Command=69
2_Command=169


does this do the same trick as TCMC ?
Back to top
View user's profile Send private message Send e-mail
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Thu Sep 18, 2008 5:53 pm    Post subject: Reply with quote

Yes you can execute any number of internal commands.
Code:
1_Command=...
2_Command=...
3_Command=...
4_Command=...
5_Command=...
6_Command=...
7_Command=...


You can also alternate commands with file executions like:
Code:
1_Command=...
2_File=...
2_Path=...
2_Parameter=...
3_Command=...

_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TRSyntax
Junior Member
Junior Member


Joined: 21 Apr 2008
Posts: 57

PostPosted: Tue Sep 23, 2008 2:18 pm    Post subject: Reply with quote

is there anyway to have hotkeys to theese commands as well. or add program in custom commands?

like for an instance:

Quote:
[Button 2 Normal]
1_Command=69
2_Command=169


does this do the same trick as TCMC ?


i can use hotkeys to open a TCMC command, can i do this with this prog as well ?

my tcmc gets killed by my antivirus all the tim and i cant whitelist it with my antivirus program :S stupid
Back to top
View user's profile Send private message Send e-mail
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Wed Sep 24, 2008 6:08 am    Post subject: Reply with quote

Yes, you can use the program for triggering macros by hotkeys.

Just create a user defined command by creating the "usercmd.ini" in the same directory as "wincmd.ini" with an entry like:
Code:
[em_SwitchBothPanelsToThumbnailMode]
cmd=**your path to Toolbar.exe**\Toolbar.exe
param=2
path=**your path to Toolbar.ini**


Then you need two entries in the "Toolbar.ini" like:
Code:
[Button 2 Normal]
1_Command=69
2_Command=169

[Button 2 Ctrl]
1_Command=69
2_Command=169


I created both entries, so the hotkey can have the ctrl-key pressed or not.

Now you can just assign any hotkey to the command: em_SwitchBothPanelsToThumbnailMode
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sgp
Senior Member
Senior Member


Joined: 31 Jan 2005
Posts: 355

PostPosted: Tue Feb 03, 2009 4:51 pm    Post subject: Reply with quote

Hi, nice script!
Is it possible to specify a TC "command with parameter", like OPENBAR, CD, LOADSEARCH, etc. ?
The comments in the script say that the script doesn't use IniRead because sometimes quotes are omitted. Could you please provide an example of when quotes are omitted? Omitted means that they disappear, right?
Back to top
View user's profile Send private message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Tue Feb 03, 2009 5:10 pm    Post subject: Reply with quote

Internal commands with parameters are not supported yet.
1. I don't have a clue how. (Someone tell me how and I'll try.)
2. I don't need them.

As far as I know (didn't try again) the automatic "Iniread" (which I didn't use in this program) let disappear some quotes. (bug and feature from Autohotkey) For example in parameter strings like this:
Code:
1_File=notepad.exe
1_Parameter="C:\directory with some spaces\textfile.txt"

The command executed is:
Code:
notepad.exe C:\directory with some spaces\textfile.txt

and not:
Code:
notepad.exe "C:\directory with some spaces\textfile.txt"

So my self written function used in this script is just a workaround.
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sgp
Senior Member
Senior Member


Joined: 31 Jan 2005
Posts: 355

PostPosted: Wed Feb 04, 2009 4:17 am    Post subject: Reply with quote

Samuel wrote:
Internal commands with parameters are not supported yet.
1. I don't have a clue how. (Someone tell me how and I'll try.)
2. I don't need them.
Unfortunately I need them but I have no clue how to implement them. I don't know if the Windows SendMessage interface that your script uses to send command IDs to TC can support string parameters.
Quote:

As far as I know (didn't try again) the automatic "Iniread" (which I didn't use in this program) let disappear some quotes. (bug and feature from Autohotkey) For example in parameter strings like this:
Code:
1_File=notepad.exe
1_Parameter="C:\directory with some spaces\textfile.txt"

The command executed is:
Code:
notepad.exe C:\directory with some spaces\textfile.txt

and not:
Code:
notepad.exe "C:\directory with some spaces\textfile.txt"

So my self written function used in this script is just a workaround.
I see. This issue can be entirely resolved in the ini file, so you could use the AHK IniRead, it isn't buggy. Microsoft defines an ini file entry as
Code:
name="contents"
where the Windows readINI API - which I think AHK calls - strips the quotes. So if you need to surround a string with quotes, you have to double the quotes
Code:
name=""contents""
More precisely, you're not doubling the quotes, you are just applying the correct syntax, which requires contents to be quoted. The Windows API dequotes only when it finds quotes as the first and last characters in the string. So if you write
Code:
name=no "quotes"
Windows API will set name to no "quotes" just as if you'd written
Code:
name="no "quotes""
Confusing, I know, but consistent once you know the rules.
Back to top
View user's profile Send private message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Wed Feb 04, 2009 4:45 am    Post subject: Reply with quote

sgp wrote:
Unfortunately I need them but I have no clue how to implement them. I don't know if the Windows SendMessage interface that your script uses to send command IDs to TC can support string parameters.


I just found a topic, where Christian Ghisler stated that it is not possible to use all "parameter-commands" by external applications like Autohotkey. But a workaround with user commands exists.

Just add user commands for your "parameter-commands".

sgp wrote:
More precisely, you're not doubling the quotes, you are just applying the correct syntax, which requires contents to be quoted. The Windows API dequotes only when it finds quotes as the first and last characters in the string.


I knew about this behavior, but for "first time users" its more confusing. So I decided to use the workaround. So I don't use 100% Microsoft compatible ini-files. Microsoft has to deal with it. Very Happy

I don't want to change it. (You may as the code is free.)
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sgp
Senior Member
Senior Member


Joined: 31 Jan 2005
Posts: 355

PostPosted: Wed Feb 04, 2009 4:54 am    Post subject: Reply with quote

I came up with a workaround based on sending keys to the command line. It works for me. For instance, to open %TEMP% in a new tab and show custom column set #6:
Code:

[Button 4 Normal]
; cm_OpenNewTab
1_Command=3001
; cm_ClearCmdLine
2_Command=2004
; change dir to ...
3_SendInput={Right}cd %TEMP%{Enter}
; SrcCustomView6
4_Command=276

The modifications to the script are simple, starting at line 61:
Code:

; ### --------------------------------------------------------------------------
; ### execute commands & files & AHK SendInput

Loop {
 Current_Command := NewIniRead(Section,A_Index . "_Command")
 Current_File    := NewIniRead(Section,A_Index . "_File")
 Current_SendInput     := NewIniRead(Section,A_Index . "_SendInput")
 if(Current_Command=="" && Current_File=="" && Current_SendInput=="") {
    if(A_Index=="1") {
       msgbox,16,No instructions for this button!,No entry in section "%Section%" of "Toolbar.ini".
;       msgbox,16,Keine Anweisungen für den Knopf!,Kein Eintrag in Sektion "%Section%" der "Toolbar.ini".
    }
    break
 }
 if(Current_Command!="") {
  SendMessage,1075,%Current_Command%,0,,ahk_class TTOTAL_CMD
 }
 if(Current_File!="") {
  Current_Parameter := NewIniRead(Section,A_Index . "_Parameter")
  Current_Path      := NewIniRead(Section,A_Index . "_Path")
  StringReplace,Current_Path,Current_Path,`%P,%Parameter_P%,All
  StringReplace,Current_Parameter,Current_Parameter,`%P,%Parameter_P%,All
  StringReplace,Current_Parameter,Current_Parameter,`%N,%Parameter_N%,All
  StringReplace,Current_Parameter,Current_Parameter,`%S,%Parameter_S%,All
      Run,"%Current_File%" %Current_Parameter%,%Current_Path%
 }
 if(Current_SendInput!="") {
  SendInput %Current_SendInput%
 }
}

ExitApp
Back to top
View user's profile Send private message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Wed Feb 04, 2009 5:22 am    Post subject: Reply with quote

Thanks! Good idea.

I extended the program with your lines.
Arrow See the first post for the new files (ahk and exe).
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sgp
Senior Member
Senior Member


Joined: 31 Jan 2005
Posts: 355

PostPosted: Wed Feb 04, 2009 6:16 am    Post subject: Reply with quote

I'm glad you liked it.
Typo: Button 4 Normal example needs square brackets in first posting.
Back to top
View user's profile Send private message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Wed Feb 04, 2009 6:34 am    Post subject: Reply with quote

Thanks again.
If I have time I could write a gui for the ini-file.

Hopefully TC 7.5, TC 8.0, ... brings internal support for something like this.
Perhaps not only for ctrl, but also for other modifiers like: shift, alt & windowskey.
To differ between left-mouse-clicks, middle-mouse-clicks and right-mouse-clicks would be great too.
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Horst.Epp
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 2540
Location: Germany

PostPosted: Wed Feb 04, 2009 11:11 am    Post subject: Reply with quote

Samuel wrote:
Thanks! Good idea.

I extended the program with your lines.
Arrow See the first post for the new files (ahk and exe).


This new version is bad. It never terminates after running a program and consumes a lot of CPU while running my Editor from a button.
Version 0.1 works just fine with the same definitions.
Back to top
View user's profile Send private message
Samuel
Power Member
Power Member


Joined: 29 Aug 2003
Posts: 1830
Location: Brandenburg, Germany

PostPosted: Thu Feb 05, 2009 3:29 am    Post subject: Reply with quote

Thanks - corrected.
Just one wrong char. Rolling Eyes
"!=" != "==" Very Happy
_________________
QuickSearch eXtended | ButtonBar eXtended | www.familie-plentz.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 1 of 10

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group