Asdafa Posted June 25, 2010 Share Posted June 25, 2010 Hi. So i have this variable. I want to send but it only sends the first letter or number. expandcollapse popupHotkeySet ("{esc}", "Stop") Func Stop () Exit 0 EndFunc Global $time, $add, $a, $start ,$Timedif #include <GUIConstantsEx.au3> #include <windowsconstants.au3> MENU() Func MENU() GUICreate("Bella", 275, 200) GUISetBkColor(0xaaaaaa) GUICtrlCreateLabel("word", 30, 15) $time = GUICtrlCreateinput("",30,30,100,20) $add = GUICtrlCreateButton("Add", 150, 29, 33 ) $start = GUICtrlCreateButton("Start", 100, 150, 75,50) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $start Then s() If $msg = $add Then Add() If $msg = $add Then MsgBox(0, "Added", ($a)) wend GUIDelete() EndFunc Func Add() $a = GUICtrlRead($time) EndFunc Func s() sleep (3200) Send("{" & $a & "}") sleep (100) EndFunc I kinda tried all i know and it is not working. I was happy i finaly found it but it only sends 1 letter or number. Send("{" & $a & "}") this is failing me but i don't know why. A small explanation would be nice. thnx Link to comment Share on other sites More sharing options...
UEZ Posted June 25, 2010 Share Posted June 25, 2010 I never worked with send but this is working: Just replace the Func s() Func s() sleep (3200) $aS = StringSplit($a, "", 2) ;put all characters to an array If IsArray($aS) Then For $i = 0 To UBound($aS) - 1 ;send each character from the array Send("{" & $aS[$i] & "}") Next EndIf sleep (100) EndFunc BR, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 25, 2010 Moderators Share Posted June 25, 2010 Asdafa,Welcome to the AutoIt forum. To send the {} characters, you need to include the "raw" flag - look in the Help file for more details on that.I have also adjusted a few other bits of your code - please ask if anything I have done is unclear: expandcollapse popup; Putting includes first in a good idea #include <GUIConstantsEx.au3> #include <windowsconstants.au3> HotKeySet("{esc}", "Stop") Func Stop() Exit 0 EndFunc ;==>Stop Global $time, $add, $a, $start, $Timedif MENU() Func MENU() GUICreate("Bella", 275, 200) GUISetBkColor(0xaaaaaa) GUICtrlCreateLabel("word", 30, 15) $time = GUICtrlCreateInput("", 30, 30, 100, 20) $add = GUICtrlCreateButton("Add", 150, 29, 33) $start = GUICtrlCreateButton("Start", 100, 150, 75, 50) GUISetState() While 1 ; A Switch structure is easy to maintain and less cluttered Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $start s() Case $add Add() ; You do not need {} here, you need "" MsgBox(0, "Added", $a) EndSwitch WEnd GUIDelete() EndFunc ;==>MENU Func Add() $a = GUICtrlRead($time) EndFunc ;==>Add Func s() Sleep(3200) ; Use the "raw" flag Send("{" & $a & "}", 1) Sleep(100) EndFunc ;==>sI hope that is all clear. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now