nacerbaaziz

how to get the selected text in edit or input

9 posts in this topic

#1 ·  Posted

Hello my friends
I have an urgent question, please help.
How do I select all the text in the edit or input
And how to get the currently selected text
Please help urgently
Greetings and thanks for all

Share this post


Link to post
Share on other sites



#2 ·  Posted

2 minutes ago, nacerbaaziz said:

Please help urgently

Where is the fire?

When you want to get proper help you really need to provide better information as it all depends on what kind of application you want to retrive this text from.   Is it an Browser or native Windows application? 
Have you tried anything yet or are you in such a hurry that you can't be bothered to do some research yourself first? :)

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hi
no not from any external application, from the autoit script
For example

GUICreate("edit test")
$edit = GUICtrlCreateEdit("", 50, 10, 100, 50)
_GUICtrlEdit_SetText($edit, "test, this is a test" & @crlf & "how to select all text from this edit please")

I searched a lot and i found several publications explaining this but didn't work.

to selecte all the text in edit or input  i found function:

_GUICtrlEdit_SetSel

But I did not succeed in identifying all the text
and about how to get the selected text it couldn't find function do this job and all roads reached don't do what I want.
Please help me in this.

Share this post


Link to post
Share on other sites

#4 ·  Posted

2 hours ago, Jos said:

Where is the fire?

in a rear place about which we can't discuss here  :)

 

@nacerbaaziz

1 hour ago, nacerbaaziz said:

to selecte all the text in edit or input  i found function:
_GUICtrlEdit_SetSel
But I did not succeed in identifying all the text

Helpfile :
_GUICtrlEdit_SetSel ( $hWnd, $iStart, $iEnd )
Remarks : If the $iStart is 0 and the $iEnd is –1, all the text in the edit control is selected.

 

1 person likes this

Share this post


Link to post
Share on other sites

#5 ·  Posted

Thank you Dear
the selection code works for me
now I need how to get selected text
to add it to the Clipboard
Please help me
thanks in advance

Share this post


Link to post
Share on other sites

#6 ·  Posted

2 hours ago, nacerbaaziz said:

how to get selected text

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

thank you verry much

Share this post


Link to post
Share on other sites

#8 ·  Posted

A simple question
Instead of selecting all and then get the selection, why not directly use GuiCtrlRead which reads the whole content ?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Welcome again
Dear I am currently creating a text editor for the blind users
In this editor I lacked these options
but now I have reached it successfully
Thanks to everyone who responded to my question
Greetings to all

Edited by nacerbaaziz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • nikink
      By nikink
      Hi all,
      I have a bit of code that works on my old Win10 PC, that fails on my new Win10 PC, and I think the only significant difference is the version of Autoit - old PC has 3.3.12, new has 3.3.14.
      I couldn't find anything mentioned in the change logs though, so perhaps I'm wrong.
      Anyway, the code to replicate my issue is:
      Test('username', 'DOMAIN') ; THIS ERRORS: ;Test('localun', 'DOMAIN') ; THIS ERRORS: ;Test(' ', ' ') ; THIS ERRORS: ;Test('', '') ; THIS ERRORS: ;Test('localun', '') ; THIS ERRORS: ;Test('', 'DOMAIN') Func Test($un, $dom) $compName = 'PCNAME' $FullName = '.' $Description = '.' ; get the WIM object $objWMIService = ObjGet("winmgmts:\\" & $compName & "\root\cimv2") ; get default user full name and description $objAccount = $objWMIService.Get("Win32_UserAccount.Name='" & $un & "',Domain='" & $dom & "'") If IsObj($objAccount) Then $FullName = $objAccount.FullName $Description = $objAccount.Description EndIf ConsoleWrite($FullName & @CRLF) ConsoleWrite($Description & @CRLF) Return EndFunc  
      On my old PC this code will output just . and . for each of those line currently commented out. Which is fine.
      On my new PC any of those commented out lines of code cause an error, and the script won't even compile.
      $objAccount = $objWMIService.Get("Win32_UserAccount.Name='" & $un & "',Domain='" & $dom & "'") $objAccount = $objWMIService^ ERROR I'm very much a newb with the WMI stuff and objects, but it looks like the .Get property is failing when either $un or $dom aren't valid in v3.3.14, whereas in 3.3.12 the .Get would fail to return an object, which is then caught by the If statement.
      Am I on track with this? Is there some new/better way to code the example so that 3.3.14 will compile it?
    • nacerbaaziz
      By nacerbaaziz
      Hi all
      I want a way to get the last key pressed.
      I have a program that works with keyboard shortcuts and I want to  give the permission for the user to edit shortcut keys depending on what suits him
      i  want to make read-only edit box and the program writes the latest shortcut key pressed
      Please help me,
      greetings to all
      And thanks in advance
    • nacerbaaziz
      By nacerbaaziz
      hello guys
      how are you؟
      I hope to be fine.
      I have a question  please
      how do I get the menu item that was pressed without that contains a variable؟
      For example I have a menu  of Favorites and I want the script recognizes the existing path in the pressed item
      i'll repeat to tell the item does not contain a variable
      Is there any solution
      if you want to explain more I could write an example of what I want.
      Greetings to all,
      thanks in advance
    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I want create retractable bar using autoit
      I tried creating slider, but there's a problem with screen reader for the blind, so is there another retractable tape?
      It is advisable to not accept dragging with the keybord only with  mouse
      note:
      This bar is needed in the process of raising and lowering the volume
      I hope that there is a solution to do that
      i waiting your responses.
      Thanks in advance to all members and administrators