Jump to content
Sign in to follow this  
nacerbaaziz

question about send function - (Moved)

Recommended Posts

hello autoit group

please i've a question

i had make a function that put some thing into the clipBoard and paste it

using the send function

e.g

ClipPut("hello")

send("^v")

 

when the keyboard is english all things work fine

but when the keyboard is arabic the send command write the ltr v insted of the text in clipboard

i was tryed to use

send("{ctrldown}v{ctrlUp}")

but the same

please can any one help me

 

Share this post


Link to post
Share on other sites

@Nine, i don't know if it work with an external GUI
this is the code that i tried
i hope  if it work with me
because my program is spicielly to the arabs users for that the arabic must be in the keybord
 

$text = "text to paste"
$OldText = ClipGet()
WinActivate($h_CRNTWND, ""); the handle of the Active Window
do
Until WinActive($h_CRNTWND)
clipPut($text)
BlockInput(1)
Send("{CTRLDOWN}")
sleep(20)
Send("v")
sleep(20)
Send("{CTRLUp}")
BlockInput(0)
ClipPut($OldText)

 

Share this post


Link to post
Share on other sites
29 minutes ago, nacerbaaziz said:

i don't know if it work with an external GUI

Well the only way to know for sure is to test it, right ?

Use the control handle of the input box you want to paste it to.

Share this post


Link to post
Share on other sites
1 minute ago, Nine said:

Well the only way to know for sure is to test it, right ?

Use the control handle of the input box you want to paste it to.

hello sir, the problem i can't know the plase where the user paste, i tried controle set text, but the problem the user can paste the text into web edit or an GUI or java application,

what am trying to make is an multi clipBoard i meen an clipboard history store

for that i can't know the place where the user will paste it

i tried the sendMessage with the handle of the window but it didn't work

Share this post


Link to post
Share on other sites

I see...Sorry, I don't know.  But I am pretty sure there is a way to paste text with arabic keyboard, no ?

Anyway, one last solution I can think of is to use 

Local $hWnd = _WinAPI_WindowFromPoint ($tPoint)

to get the handle of a static input box.  I tested and it works. Use preferably mouse position.  Caret position may not work properly.

Share this post


Link to post
Share on other sites

hello again
please community there are no function can press the keys with not send command
because i think the problem is with send function
when i try to paste the text with ctrl+v manualy all thing work fine even if the keyboard is arabic or english or franch
i couldn't find any solution to that
i finished my tool this problem only if it corrected i'll share the tool to othersbut if the keyboard in arabic and i pressed control+v manualy it work with out problem

Share this post


Link to post
Share on other sites

Send is not the problem.  I have a french keyboard, I am using send function all the time without a single issue. It is probably the window ($h_CRNTWND) that should receive the paste that is causing the problem.  When I run your code, it works perfect.  If you want us to help you, you must provide a runable script that replicates the dysfonction of the Send.  Otherwise, I don't think anyone here can help you out. 

Share this post


Link to post
Share on other sites

this code e.g

when i run it and the keyboard in english or franch all things work fine

but in arabic no

it write the l V

but when i press ctrl+v manualy it paste the text

here is the code

global $text = "some text"
hotkeySet("^{f2}", "pasteText")
hotkeySet("{esc}", "Kill")
While 1
sleep(100)
Wend
func pasteText()
local $crntClip = ClipGet()
ClipPut($text)
Send("^v")
clipPut($crntClip)
return 0
endFunc
func kill()
exit
endFunc

 

Share this post


Link to post
Share on other sites

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

hello team

now i did a test and it successed 

i tried to send the l in arabic that in the same place to the l v

it ر

after that i've make a function to get the keyboard lng and i did an if to detect the kb lng

here is the code

and thank you for your help

with my greetings

#include <WinAPILocale.au3>
global $text = "some text"
hotkeySet("^{f2}", "pasteText")
hotkeySet("{esc}", "Kill")
While 1
sleep(100)
Wend
func pasteText()
local $crntClip = ClipGet()
ClipPut($text)
Send("{CTRLDOWN}")
if GetSystemLNG(@KBLayout) = "arabic" then
Send("ر")
else
Send("v")
endIf
send("{CTRLUp}")
clipPut($crntClip)
return 0
endFunc
func kill()
exit
endFunc
func GetSystemLNG($String = "")
if $String = "" then
local $s_Lng = _WinAPI_GetLocaleInfo(0x0400, 0x0001)
else
local $s_Lng = $String
endIf
local $LngID ='0x' & StringTrimLeft($s_lng, 4) & StringTrimLeft($s_lng, 4)
local $idBord = _WinAPI_GetLocaleInfo(BitAND($LngID, 0xFFFF), 0x1001)
return $idBord
endFunc
#include <WinAPILocale.au3>
global $text = "some text"
hotkeySet("^{f2}", "pasteText")
hotkeySet("{esc}", "Kill")
While 1
sleep(100)
Wend
func pasteText()
local $crntClip = ClipGet()
ClipPut($text)
Send("{CTRLDOWN}")
if GetSystemLNG(@KBLayout) = "arabic" then
Send("ر")
else
Send("v")
endIf
send("{CTRLUp}")
clipPut($crntClip)
return 0
endFunc
func kill()
exit
endFunc
func GetSystemLNG($String = "")
if $String = "" then
local $s_Lng = _WinAPI_GetLocaleInfo(0x0400, 0x0001)
else
local $s_Lng = $String
endIf
local $LngID ='0x' & StringTrimLeft($s_lng, 4) & StringTrimLeft($s_lng, 4)
local $idBord = _WinAPI_GetLocaleInfo(BitAND($LngID, 0xFFFF), 0x1001)
return $idBord
endFunc

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Danyfirex
      AT Command UDF - for control AT Modems, send SMS, get SMS
       
      Changelog:
      #cs 1.0.0 2020/10/03 . First version - Danyfirex + mLipok 1.0.1 2020/10/04 . Added - Function - _ATCmd_IsPINReady - Danyfirex . Added - Function - _ATCmd_IsPINRequired - Danyfirex . Added - Function - _ATCmd_IsSIMInserted - Danyfirex . Added - Function - _ATCmd_IsSenderSupported - Danyfirex . Added - Function - _ATCmd_OnPINReques - Danyfirex . Added - Function - _ATCmd_SMS_ListTextMessages - Danyfirex . Added - Function - _ATCmd_SetPIN - Danyfirex . Added - Function - __ATCmd_GetPINCounter - Danyfirex - Added - ENUM - $ATCmd_ERR_PIN - Danyfirex - Added - ENUM - $ATCmd_ERR_SIM - Danyfirex . Changed - __ATCmd_ComposePDU() - using _ATCmd_UseUCS2() internally instead parameter - Danyfirex . Suplemented - #CURRENT# - Danyfirex . . 1.0.2 2020/10/05 . Added - ENUM - $ATCmd_MSGLIST_* - mLipok . Added - ENUM - $ATCmd_STATUS__* - mLipok - Added - ENUM - $ATCmd_ERR_PARAMETER - mLipok . Added - _ATCmd_UsePDU() - parameter validation - mLipok . Added - _ATCmd_UseUCS2() - parameter validation - mLipok . Added - more error logs . Changed - MagicNumber replaced with Standard UDF constants - mLipok . Small refactoring - mLipok . . 1.0.3 2020/10/05 . CleanUp - Danyfirex . . 1.0.4 2020/10/05 . Small refactoring - Danyfirex . CleanUp - Danyfirex . . 1.0.5 2020/10/23 . _ATCmd_FullLoging - mLipok . _ATCmd_CMEESetup() ... @WIP - mLipok . $ATCMD_STATUS_11_SUBSCRIBERNUMBER - mLipok . . 1.0.6 2020/10/25 . __ATCmd_CMSErrorParser() - mLipok . . @LAST https://www.nowsms.com/gsm-modem-cms-error-code-list https://m2msupport.net/m2msupport/at-command-to-enable-error-codes/ https://www.micromedia-int.com/en/gsm-2/73-gsm/669-cme-error-gsm-equipment-related-errors https://assets.nagios.com/downloads/nagiosxi/docs/ATCommandReference.pdf https://www.maritex.com.pl/product/attachment/40451/15b4db6d1a10eada42700f7293353776 https://www.multitech.net/developer/wp-content/uploads/2010/10/S000463C.pdf https://www.telit.com/wp-content/uploads/2017/09/Telit_AT_Commands_Reference_Guide_r24_B.pdf https://docs.rs-online.com/5931/0900766b80bec52c.pdf PDU Format / Testers / Encoders / decoders https://m2msupport.net/m2msupport/sms-at-commands/#pduformat http://smstools3.kekekasvi.com/topic.php?id=288 #ce  
       
      Saludos
    • By Drac89
      Hi Team, 
      I am trying to send credentials via autoit on a web app launched via IE. I am passing the credentials into variables and trying to send them send("$username") but username field isn't getting populated. But the password field, I can send the credential, also when I try ieformsetvalue and set the username wrt username field fetched, it's getting send but my login button remains greyed out. 
      Can angularjs keydown function interfere in the autoit send process and not allow the credentials passed if it's not typed out? This is a general question to understand if javascript or angular js etc could detect if the credentials are automated, then it might not detect it as a keydown? 
    • By nacerbaaziz
      hello evrybody
      here is an example about how to split your texts using a delimiter with the ability to select how much of delimiters shows in each colum  with $i_number
      e.g
      you have a long text and you want to split it in an array
      that evry colum have a number (n) of lines
      i made a function that do that for you
      just call it with a three params
      $s_text
      your text
      $i_number
      the number that you want to put in each col
      $s_siparator
      the siparator
      default is "|"
      here is the function with example
      i hope that it will be useful for you
       
      ****
       
      #include <Array.au3> $s_txt = "some text1some text2|some text3|some text4|some text5|some text6" $array = splitText($s_txt, 2) _ArrayDisplay($array) Func splitText($s_text, $i_number, $s_siparator = "|") Local $a_TXT = StringSplit($s_text, $s_siparator) Local $a_Return[$a_TXT[0] + 1] If ($a_TXT[0] <= $i_number) Or ($i_number <= 0) Then ReDim $a_Return[2] $a_Return[0] = 1 $a_Return[1] = $s_text Return $a_Return EndIf Local $i_Processed = 1, $i_arrayProcessed = 1 Do For $i = $i_Processed To ($i_Processed + $i_number) - 1 If ($a_TXT[0] < $i) Then ExitLoop If Not ($a_Return[$i_arrayProcessed]) Then $a_Return[$i_arrayProcessed] = $a_TXT[$i] Else $a_Return[$i_arrayProcessed] &= $s_siparator & $a_TXT[$i] EndIf $i_Processed += 1 Next $i_arrayProcessed += 1 Until ($a_TXT[0] < $i_Processed) ReDim $a_Return[$i_arrayProcessed] $a_Return[0] = $i_arrayProcessed - 1 Return $a_Return EndFunc ;==>splitText
      accept my greetings
      thanks to
      @Dan_555
      for his notes
       
    • By nacerbaaziz
      hello autoit team
      please i've a question for you.
      am creating a audio player
      and in this audio player i want to show the current trac info
      such as the total time and the position ... etc
      i know i can show it as label
      but the screen reader for the blind read the text every change
      because it have a screen scan
      what i want is to show this informations but such image or icon
      i mean i need to create
      GUICtrlCreatepic or GUICtrlCreateicon ....
      or some thing as that
      and show this informations as image on it
      i think that i can do that with the 
      _GDIPlus functions
      but i couldn't find the currect way to do it
      i tried the _GDIPlus_GraphicsDrawString
      but i couldn't know how it work
      what i need is a small example that create a GUI
      and add a multy line text to it as graphic or image.
      so i need a simple way because it will changed every sec
      i hope any one can help me to do that
      global $GUI = GUICreate("text", 400, 400) global $label = GUICtrlCreateLabel(GetText(), 10, 10, 380, 380) GUISetState() do sleep(100) until GUIGetMSG() = -3 exit func GetText() return StringFormat("file name is test.mp3 \r\n total time is 00:30:00 \r\n position is 00:05:50") endFunc  
×
×
  • Create New...