| View previous topic :: View next topic |
| Author |
Message |
deletarus
Joined: 08 Dec 2007 Posts: 9
|
Posted: Thu Dec 20, 2007 1:06 am Post subject: Get highlighted text |
|
|
I'm looking for a way to access text that is highlighted, not necessarily selected.
The exact situation is this, I have a folder class window open (just a folder with subfolders), one of them was selected, the window is no longer active and I want to be able to get the selected folder's name without having to:
activate window
send F2
send control-c
send esc
reactivate other window
etc.
is this possible, I haven't been able to find it anywhere in the forums. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1499
|
Posted: Thu Dec 20, 2007 1:33 am Post subject: |
|
|
hmm... that seems like a tall order, but maybe there's another way.
If all you're going to be using it for is files in windows explorer, then you can make a LButton hotkey which gets info from the selected file and stores that info to a variable for later use.
Example: | Code: | ~*LButton::
IfWinNotActive, ahk_class CabinetWClass
return
oclip := Clipboardall
sleep 150
send ^c
sleep 150
File_Path_for_Later_Use := Clipboard
Clipboard := oclip
msgbox, %File_Path_for_Later_Use%
return |
partially tested... _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
deletarus
Joined: 08 Dec 2007 Posts: 9
|
Posted: Thu Dec 20, 2007 2:00 am Post subject: |
|
|
Intriguing. How does that work? How does it access the full path of the file?
That is very similar to what I would like to do, but without having to click on anything. Would there be a way to get the same functionality without having to click on the file?
Also, with that script, when I drag a file the full text of the script pops up in a msgbox (i just thought it was interesting)
Thanks for your prompt reply BTW
[edit]
it seems like the control c call would copy the file, not get it's info, that's what I meant by "how does it work?" just thought I'd clarify.
would this also work if I just activated the window and sent a control-c? I may have to try it and see if it copies the file or not... |
|
| Back to top |
|
 |
JDN
Joined: 24 Mar 2004 Posts: 135
|
Posted: Thu Dec 20, 2007 3:22 am Post subject: |
|
|
I think it would help if you could tell us the name of the App you are using. Is it Windows Explorer?
It's hard for me to follow the problem you describe without knowing the App. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3652 Location: Belgrade
|
Posted: Thu Dec 20, 2007 8:38 am Post subject: |
|
|
You will have to use COM or RemoteBuff to access the data.
Alternatively, use Favmenu. _________________
 |
|
| Back to top |
|
 |
|