Sign in to follow this  
Followers 0
haXor4life

How to change this code in order to send text more precisely?

17 posts in this topic

#1 ·  Posted (edited)

#include <String.au3>

$Text = FileRead("file.txt")

$Text = _StringBetween($Text, "anything", "anything")

For $i = 0 To UBound($Text) -1

Send($Text[$i])

Sleep(5000)

Next

Сan you tell how to change this code in order to send text more precisely?

Please, code, instead of advice about Controlsend or anything of this kind. Helpfile didn't help me.

Right now send is inadequate: punctuation come to letters etc

This code actually sends text between "anything".

Edited by haXor4life

Share this post


Link to post
Share on other sites



#include <String.au3>

$Text = FileRead("file.txt")

$Text = _StringBetween($Text, "anything", "anything")

For $i = 0 To UBound($Text) -1

Send($Text[$i])

Sleep(5000)

Next

Сan you tell how to change this code in order to send text more precisely?

Please, code, instead of advice about Controlsend or anything of this kind. Helpfile didn't help me.

Right now send is inadequate: punctuation come to letters etc

This code actually sends text between "anything".

What is it that you think is imprecise about what you are doing at the moment?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

What is it that you think is imprecise about what you are doing at the moment?

Sending of non-english letters for example.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Try to use ControlSetText() where Send() is problematic - especially on non-english keyboard layouts.

ControlSetText("", "", "", $Text[$i])

It didn't sent anything.

Edited by haXor4life

Share this post


Link to post
Share on other sites

Try...

Send($Text[$i], 1)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Try...

Send($Text[$i], 1)

8)

It didn't work. It just reprints symbols in current layout.

Can someone help to make it some kind of copy/paste?

Edited by haXor4life

Share this post


Link to post
Share on other sites

You can split the string and use the {ASC value} using AscW. Right now send it not fully unicode compatible. Look here for example

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thank you.

ClipPut ($Text[$i])

Send('^v')

This works great. Edited by haXor4life

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Thank you! It is really cool that you exist.

Edited by haXor4life

Share this post


Link to post
Share on other sites

Thank you! It is really cool that you exist.

Haha, best "thank you" post ever !

Share this post


Link to post
Share on other sites

Do you guys know why this code

#include <String.au3>

Global $aTmp, $sTmp
Global $Text = FileRead("file.txt")

$Text = _StringBetween($Text, "anything", "anything")
For $i = 0 To UBound($Text) - 1
    $aTmp = StringSplit($Text[$i], '')
    $sTmp = ''
   
    For $j = 1 To $aTmp[0]
        $sTmp &= '{ASC ' & AscW($aTmp[$j]) & '}'
    Next
    Send($sTmp)
    Sleep(5000)
Next

sends ♪◙ with text? And how to get rid of this?

This code

#include <String.au3>

$Text = FileRead("file.txt")
$Text = _StringBetween($Text, "anything", "anything")
For $i = 0 To UBound($Text) - 1
    ClipPut($Text[$i])
    Send('^v')
    Sleep(5000)
Next

stopped working. It just sends v after reboot of computer. Another reboot doesn't help.

Share this post


Link to post
Share on other sites

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Okay I changed

Send('^v')

with

Send("+{INSERT}")

and it works again. Hope after reboot it will continue to work.

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
Sign in to follow this  
Followers 0