Packing and scripting

English support forum

Moderators: Hacker, petermad, Stefan2, white

snaggy
Junior Member
Junior Member
Posts: 43
Joined: 2006-04-25, 07:09 UTC

Post by *snaggy »

that's perfect! thanks
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

Begin {OFFTOP}
snaggy wrote:I've never seen such an active forum!
Hehe, you weren't at ruboard. Right now there are 1397 users online. The record is 2375.
End; {OFFTOP}
snaggy
Junior Member
Junior Member
Posts: 43
Joined: 2006-04-25, 07:09 UTC

Post by *snaggy »

I'm still playing with ahk, and I've got lots of questions to do, but I think this topic isn't perfect for that... Do you think I can post them here in this forum or I'd better go somewhere else (an ahk dedicated forum... but they don't know TC!)

Anyway, I have a question :D

I was trying to get the text of the gui element TMyPanel2 (at the very left of the command line, it shows the current folder)
I used the command

GuiControlGet, myvar,, TMyPanel2

to store it in a var (myvar) but it doesn't work... why? Maybe I should say something about ClassNN?
User avatar
Hacker
Moderator
Moderator
Posts: 13136
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

snaggy,
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?
You don't need to do anything in TC, AHK captures the hotkey before TC sees it.

Code: Select all

$^F9::
	DoSomething
Return
I was trying to get the text of the gui element TMyPanel2 (at the very left of the command line, it shows the current folder)
I currently don't have the time to check why your version isn't working, but to get the current dir I use the following code (from Automatic directory-specific configuration / actions):

Code: Select all

#IfWinActive, ahk_class TTOTAL_CMD
$<#LShift::
	WinGetText, Text, A
	Loop, Parse, Text, `n
	{
		If A_Index = 3
		{
			StringTrimRight, Dir, A_LoopField, 2
			Break
		}
	}
	DoSomethingWithDir
Return
HTH
Roman
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.
snaggy
Junior Member
Junior Member
Posts: 43
Joined: 2006-04-25, 07:09 UTC

Post by *snaggy »

I don't quite understand your code, still I tried it out but it gives me (dir) something else:

0 k / 245 k in 0 / 6 files, 0 / 1 dir(s

That's the text over what I want to get (the file path)
snaggy
Junior Member
Junior Member
Posts: 43
Joined: 2006-04-25, 07:09 UTC

Post by *snaggy »

I solved it

;GET PATH
<^>!F4::
If WinActive("ahk_class TTOTAL_CMD")
{
Send {F2}{CTRLDOWN}c{CTRLUP}{ESC}
flnm = %clipboard%
ControlGetText, pth, TMyPanel2
StringTrimRight, pth, pth, 1
clipboard = %pth%\%flnm%
msgbox, %pth%\%flnm%
}

maybe it's a bit stupid but it works!

bye
Post Reply