Jump to content
Wingens

Controlsend text

Recommended Posts

Wingens

Hi,

i am creating a hotkey script for my work.
Now i am hitting a wall, i have to be able to send a line of text using a combination of keys.
The problem i have is not in the combination but in the line of text i am trying to send.

What i am trying to send contains the symbol: !
Everytime i use my script it does send my line of text until it needs to send the !

First i tried:     
ControlSend("", "", "", "svm{$}8{4}{!}", 0)
ControlSend("", "", "", "{enter}")

Right now i changed the code to read the line of text from a ini file but still the problem.

Maybe someone has any ideas?

Share this post


Link to post
Share on other sites
Shoby

Hello Wingens,

If you state your issue briefly, We can try to help you out..

 

You have problems to read from .ini file ?

 

Share this post


Link to post
Share on other sites
Wingens

Tried the raw mode did not solve my problem.

I have no problem with reading the ini file but it sends:

svm$84

it loses the: ! at the end.

Share this post


Link to post
Share on other sites
Shoby

Wingens,

Create a ini file with Section name and Key-value format.

For example 

[Text]

Word= "The word that you want to send to ur script"

Then in your script,

Assign any variable to retrieve the text from .ini file like,

$text = IniRead (@ScriptDir & "\.ini", "Text", "Word","")

Then send this $text value to ur controlsend command

ControlSend ( "title", "text", controlID, $text)

 

Hope this will be useful for you..
 

Share this post


Link to post
Share on other sites
Shoby

Wingens,

 

Try Send("+{1}")..

Its working for me now..

Share this post


Link to post
Share on other sites
Wingens

My code right now is like that:

$var    = IniRead(@ScriptDir & "\pass.ini", "names", "pass", "")
    ControlSend("", "", "", $VAR)

Share this post


Link to post
Share on other sites
Shoby

Wingens,

 

Try this..

Controlsend("Untitled - Notepad","","[CLASS:Edit; INSTANCE:1]","svm{$}{8}{4}+{1}")

Its working for me here..

Share this post


Link to post
Share on other sites
Wingens

it does send it in a notepad or notepad ++,

but in IE it sends it differently:

svM$8$!

Somehow it chages...

Share this post


Link to post
Share on other sites
Zobengrauzis

if its IE, why no go with IE functions (_IEAttach, _IEFormElementSetValue etc).

They are more realible for tasks in thee

Share this post


Link to post
Share on other sites
Wingens

Need to read into that, don't know how that works yet...

Share this post


Link to post
Share on other sites
jvds

try
ControlSend("", "", "", "svm{$}8{4}{ASC 033}", 0)

Share this post


Link to post
Share on other sites
Wingens

The last one worked changed it a bit to between every character a sleep(50) because don't know why but some times it changes the characters is sends...

 

thx

The last one worked changed it a bit to between every character a sleep(50) because don't know why but some times it changes the characters is sends...

 

thx

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

    • SkysLastChance
      By SkysLastChance
      I must be missing something. I have had this problem multiple times. Why does F6 key not send 6 times?  
      Not working 
      ControlSend("[CLASS:#32770]", "", "", ("{F6 6}")) Working
      ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}"))  
    • Epic007
      By Epic007
      Hey guys I'm stuck with a program.....I need a make an automation which copies text from a chat bot app and paste it in notepad to log the replies of my chat bot and to analyse stuff....a lil help pls
       
       
       
       
       
       
       
      Thanks in advance
    • nooneclose
      By nooneclose
      I need to send a string of text to this popup and click on the ok button to save it.
      Here is the code I have so far:
      ;Start IE Sleep(7000) $oIE = _IECreate("http://www.google.com") Sleep(500) _IELoadWait($oIE) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window Sleep(500) WinSetState($hIE, "", @SW_MAXIMIZE) ;Wait for a browser page load to complete Sleep(3000) _IENavigate($oIE, "https://properURL.com") Sleep(8000) _IELoadWait($oIE) ;Attach to a browser control embedded in another window $oIE = _IEAttach("https://"properURL.com", url") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $oIE = ' & $oIE & @CRLF & '>Error code: ' & @error & ' Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console Sleep(2000) ;Get the title of the webpage ;Local $wTitle = _IEPropertyGet($oIE, "title") ;MsgBox($MB_SYSTEMMODAL, "Webpage title:", $wTitle) ;Clicks the new button Sleep(3000) _IEAction($nWorkOrderB, "focus") _IEAction($nWorkOrderB, "click") Sleep(5000) ;Store the Element names where the important data will be sent ;Store the long description button Local $wLongDButton = _IEGetObjById($oIE, "m65d795a4-img") ;Store the long Description field id Local $wComments = _IEGetObjById($oIE, "ma6499a9c-rte_iframe") ;Store the ok button id that is in the long description Local $wCommOk = _IEGetObjById($oIE, "m74031266-pb") ;******************************************************************************* ; Send the stored data to the proper field ;******************************************************************************* ;Click the long description button Sleep(300) _IEAction($wLongDButton, "focus") _IEAction($wLongDButton, "click") Sleep(300) ;Sends the Comments Sleep(500) _IEAction($wComments, "focus") _IEAction($wComments, "click") Sleep(500) _IEFormElementSetValue($wComments, "hello darkness my old friend") ;Click the ok button Sleep(500) _IEAction($wCommOk, "focus") _IEAction($wCommOk, "click") Sleep(500)  
      Here is the popup:

    • reida
      By reida
      Hello. Help to write the text.
      <textarea tabindex="4" class="js-input compose__labels__input" style="width: 407px; max-width: 413px;" wrap="off" autocomplete="off" data-original-name="To"></textarea>  I can not make.
      #include <IE.au3> $sLogin = 'adv' $iError = 1 $sUrl = 'https://......' $oIE = _IECreate($sUrl) ;;; _IELoadWait($oIE) $oLogin = _IEGetObjByName($oIE, "To") Sleep(7000) If IsObj($oLogin) Then _IEFormElementSetValue($oLogin, $sLogin) _IELoadWait($oIE) ; EndIf EndIf Through the selector it can be possible?
      #toolkit-154163367424641composeForm > div:nth-child(1) > div > div.compose-head__content.js-collapsed-off > div.compose-head__row-wrapper.compose-head__row-wrapper_to.js-row > div > div > div:nth-child(2) > div > div > div > textarea.js-input.compose__labels__input  
    • cramaboule
      By cramaboule
      Hi all,
       
      I was wondering if it is possible (and how) to put text on video on-the-fly (like VLC displays Title movie at the begining)
      and of course doing that in AutoIt
      Thanks in advance...
       
      C.
×