AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get highlighted text

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
deletarus



Joined: 08 Dec 2007
Posts: 9

PostPosted: Thu Dec 20, 2007 1:06 am    Post subject: Get highlighted text Reply with quote

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
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1499

PostPosted: Thu Dec 20, 2007 1:33 am    Post subject: Reply with quote

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
View user's profile Send private message
deletarus



Joined: 08 Dec 2007
Posts: 9

PostPosted: Thu Dec 20, 2007 2:00 am    Post subject: Reply with quote

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
View user's profile Send private message
JDN



Joined: 24 Mar 2004
Posts: 135

PostPosted: Thu Dec 20, 2007 3:22 am    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Thu Dec 20, 2007 8:38 am    Post subject: Reply with quote

You will have to use COM or RemoteBuff to access the data.

Alternatively, use Favmenu.
_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group