Packing and scripting
Moderators: white, Hacker, petermad, Stefan2
Packing and scripting
I have some general questions about scripting... taken the example of packing:
My problem (quite simple, just an example) : I want TC to automatically pack with a chosen packer all the files selected in the source panel, with the same directory as destination.
To do so now I use CTRL + mouse click on the icon (didn't find any shortcut or command..)
Is this a case in wich scripting can get useful? And is there a way to make scripts inside TC or I have to use external programs running in background (and using resources...) ?
bye
My problem (quite simple, just an example) : I want TC to automatically pack with a chosen packer all the files selected in the source panel, with the same directory as destination.
To do so now I use CTRL + mouse click on the icon (didn't find any shortcut or command..)
Is this a case in wich scripting can get useful? And is there a way to make scripts inside TC or I have to use external programs running in background (and using resources...) ?
bye
- majkinetor !
- Power Member
- Posts: 1580
- Joined: 2006-01-18, 07:56 UTC
- Contact:
U use scripts when you want to avoid repetition of tasks over and over.
In your case you can use batch, and that is the easiest way. Scripts inside TC don't exist, you can eventualy use plugin for that, which is not very well documented. Batch is documented on other hand and people know how to do it and it is beyond TC. U can alternatively use VBscript or JavaScript but, as I said before, for your primer, batch is no more then several lines.
If you use batch u have some tricks to hide its black winodow from appearing.
In your case you can use batch, and that is the easiest way. Scripts inside TC don't exist, you can eventualy use plugin for that, which is not very well documented. Batch is documented on other hand and people know how to do it and it is beyond TC. U can alternatively use VBscript or JavaScript but, as I said before, for your primer, batch is no more then several lines.
everything is using resources. Plugins are like 3thd party programs just with less overhead but if they are programmed bad, they can eat more resources then starting another application. So, you can't do anything here until TC have its own scripts. Batch use console applications, which have no GUI (usualy) and are usualy not made by lamers, so, again, batch is the best for you.or I have to use external programs running in background (and using resources...) ?
If you use batch u have some tricks to hide its black winodow from appearing.
Habemus majkam!
Re: Packing and scripting
Default for packing is [Alt]+[F5] (cm_packFiles). Packing to the source can be achieved with modifier Control key. (just like you do with the mouse)snaggy wrote: I want TC to automatically pack with a chosen packer all the files selected in the source panel, with the same directory as destination.
There is no internal scripting tool available. But several samples for scripting with external tools in TC are described in the Wiki.Is this a case in wich scripting can get useful? And is there a way to make scripts inside TC or I have to use external programs running in background (and using resources...) ?
Personally I prefer Autohotkey.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Enter this in your wincmd.ini (@Sheepdog: long ago you have created these, right? ):To do so now I use CTRL + mouse click on the icon (didn't find any shortcut or command..)
Code: Select all
[Shortcuts]
CA+F5=cm_PackFiles
CAS+F5=cm_PackFiles
If you know what archive you want to create, the steps
1. press Alt-Ctrl-F5
2. choose packer
3. press OK
can be scripted using AutoHotkey, that's one minute of "work".
AHK uses about 2 MB of RAM when idling and no CPU resources at all when using hotkeys only. I am using dozens of hotkeys created with AHK without any impact on system performance.
Icfu
This account is for sale
Re: Packing and scripting
2 icfu:
It works, but why? The command is always the same, how can TC understad if you always say cm_PackFiles?
2 majkinetor !:
I've never used batch, how can I get some infos about it, and about its integration in TC?
It works, but why? The command is always the same, how can TC understad if you always say cm_PackFiles?
2 majkinetor !:
I've never used batch, how can I get some infos about it, and about its integration in TC?
It's a special implementation by ghisler. Don't ask, just use it.
Edit: It doesn't work for other commands, so you can stop trying.
If you want to unpack to the same directory, just press DEL after pressing Alt-F9 (or F6). If you want to always unpack to the same directory, use this AHK script:
http://www.ghisler.ch/wiki/index.php/AutoHotkey:_Unpack_each_archive_to_a_separate_subdir
Icfu
Edit: It doesn't work for other commands, so you can stop trying.
If you want to unpack to the same directory, just press DEL after pressing Alt-F9 (or F6). If you want to always unpack to the same directory, use this AHK script:
http://www.ghisler.ch/wiki/index.php/AutoHotkey:_Unpack_each_archive_to_a_separate_subdir
Icfu
This account is for sale
Yes, or like written here:
http://www.ghisler.ch/wiki/index.php/AutoHotkey
#Include, D:\Scripts\AHK\Hotkeys.ahk
#Include, D:\Scripts\AHK\Hotstrings.ahk
#Include, D:\Scripts\AHK\Total Commander.ahk
etc... You get the idea.
You can also add #NoTrayIcon in each of your AHK files if you prefer to start them manually each time you need them.
Icfu
http://www.ghisler.ch/wiki/index.php/AutoHotkey
I have several AHK files running at the same time, each of them containing several scripts. My autohotkey.ini looks like that:(alternatively add it to the AHK autostart file AutoHotkey.ini);
#Include, D:\Scripts\AHK\Hotkeys.ahk
#Include, D:\Scripts\AHK\Hotstrings.ahk
#Include, D:\Scripts\AHK\Total Commander.ahk
etc... You get the idea.
You can also add #NoTrayIcon in each of your AHK files if you prefer to start them manually each time you need them.
Icfu
This account is for sale
I see you know a lot about ahk, I found some scripts of yours in the wiki page.
I have some questions though..
I have my unpack script working now, and i was trying the pack one. I did a kind of macro...
send ctrl alt f5, then select zip and hit OK
The ctrl alt f5 works fine, but I'd like to know how you get the windows as you did (WinWaitActive, ahk_class TDLGUNZIPALL) for the un pack.
The select zip is a problem. How can I tell him wich checkbox is it? You used
ControlSend, TCheckBox1, {SPACE}
but how to do that in my case? If I try the recorder he follows my mouse and records where it clicks....
anyway, it's getting interesting..
Last thing, is it possible to use as hotkey a single key such as F9? (I gess no, right?)
bye
I have some questions though..
I have my unpack script working now, and i was trying the pack one. I did a kind of macro...
send ctrl alt f5, then select zip and hit OK
The ctrl alt f5 works fine, but I'd like to know how you get the windows as you did (WinWaitActive, ahk_class TDLGUNZIPALL) for the un pack.
The select zip is a problem. How can I tell him wich checkbox is it? You used
ControlSend, TCheckBox1, {SPACE}
but how to do that in my case? If I try the recorder he follows my mouse and records where it clicks....
anyway, it's getting interesting..
Last thing, is it possible to use as hotkey a single key such as F9? (I gess no, right?)
bye
Right click on any script's tray icon and select Window Spy, then click on any window.I'd like to know how you get the windows as you did (WinWaitActive, ahk_class TDLGUNZIPALL) for the un pack
Sure it is.is it possible to use as hotkey a single key such as F9?
Roman
Last edited by Hacker on 2006-05-05, 18:49 UTC, edited 1 time in total.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Shit, you got me.icfu wrote:Enter this in your wincmd.ini (@Sheepdog: long ago you have created these, right? ):To do so now I use CTRL + mouse click on the icon (didn't find any shortcut or command..)Code: Select all
[Shortcuts] CA+F5=cm_PackFiles CAS+F5=cm_PackFiles
It is the Ctrl-key that tell TC to use the pack to current Dir. Assign cm_packfiles to Ctrl+F9 and it will work.snaggy wrote:I've tried to use F9 in place of ctrl alt f5 but of course it doesn't work, it gives me the standard alt f5 dialog. How does it work?
sheepdog
Last edited by Sheepdog on 2006-05-05, 17:08 UTC, edited 1 time in total.
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- majkinetor !
- Power Member
- Posts: 1580
- Joined: 2006-01-18, 07:56 UTC
- Contact:
Snagy, you can do ANYTHING with ANYTHING, so questions like can I do this or that are pointless.
AHK, batch, JS or VB can do anything you can imagine, like any other programming language.
You can find many of examples how to use batch via google.
New version of command line for Windows is named Monad and it will be very powerful and above all, object oriented, which is first in "console world" that I know (counting other operating systems).
You can connect any batch script via Start Menu and so, hotkey.
AHK, batch, JS or VB can do anything you can imagine, like any other programming language.
You can find many of examples how to use batch via google.
New version of command line for Windows is named Monad and it will be very powerful and above all, object oriented, which is first in "console world" that I know (counting other operating systems).
You can connect any batch script via Start Menu and so, hotkey.
Habemus majkam!
I had almost forgot about batch, I'll search sm about it later.. Now I realized that with some efforts almost everything can be done, as you said
by the way, I made a script wich allows me to
AltGr + F9 --> to a zip in the same directory
AltGr + F10 --> to a rar in the same directory
Alt + F9 --> extract everything in a subfolder ...
It's really great!
I still have a question: if TC has a default hotkey, for example CTRL + F9, that I'll never use and I'd like to remap to a ahk function, what should I do?
I mean: ctrlF9 prints, I want it to execute an ahk script and not the default function
bye, and thank you all for the prompt replies, I've never seen such an active forum!
by the way, I made a script wich allows me to
AltGr + F9 --> to a zip in the same directory
AltGr + F10 --> to a rar in the same directory
Alt + F9 --> extract everything in a subfolder ...
It's really great!
I still have a question: if TC has a default hotkey, for example CTRL + F9, that I'll never use and I'd like to remap to a ahk function, what should I do?
I mean: ctrlF9 prints, I want it to execute an ahk script and not the default function
bye, and thank you all for the prompt replies, I've never seen such an active forum!
Two ways:snaggy wrote:I still have a question: if TC has a default hotkey, for example CTRL + F9, that I'll never use and I'd like to remap to a ahk function, what should I do?
1. You create a usermenu entry that does nothing
[user]
menu10=cm_NoAction
and after that assign ctrl+F9 to it(Configuration->Options->Misc:Redefine Hotkeys). So TC will execute the command that does nothing and AHK will execute the command you programmed.
2. You check first if TC is active window and if yes you 'eat' the hotkey
Code: Select all
#IfWinActive, ahk_class TTOTAL_CMD
^F9::
msgbox, hallo
return
So you don't use the "~" the key would not be passed through.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams