# Search the Community

Showing results for tags 'text'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Announcements and Site News
• AutoIt v3
• AutoIt Help and Support
• AutoIt Technical Discussion
• AutoIt Example Scripts
• Scripting and Development
• Developer General Discussion
• Language Specific Discussion
• Operating System Deployment
• Windows Client
• Windows Server
• Office

### Categories

• AutoIt Team
• Beta
• MVP
• AutoIt
• Automation
• Databases and web connections
• Data compression
• Encryption and hash
• Games
• Hardware
• Information gathering
• Internet protocol suite
• Maths
• Media
• PDF
• Security
• Social Media and other Website API
• Windows
• Scripting and Development
• Operating System Deployment
• Windows Client
• Windows Server
• Office

• Forum FAQ
• AutoIt

### Calendars

• Community Calendar

• 0 Replies

• 0 Reviews

• 0 Views

Found 92 results

1. ## split your text in array example

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
2. ## show text as graphic or image in GUI

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
3. ## question about send function - (Moved)

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
4. ## Combine multiple files into one

Hello! I am new to autoit so please if someone could help me. I am trying to combine multiple .txt files but I can't get it right. In every file are the exact amout of lines ( for example here are 2 ) , I don't want to make it for just 2 lines for each txt files but for all the lines the txt files contains. The thing I want to do is : Text File 1 Hello my name I am a big ... Text File 2 is Fred, Potato head for ... Text File 3 and I like to eat pizza. Not getting this right. ... ------------------- Combine them all into one txt file like here ------------------------------ Final Text file Hello my name is Fred, and I like to eat pizza. I am a big Potato head for Not getting this right. ... Thanks for any advice! P.S. Sorry for my English, not my first language.
5. ## Copying Specific lines of code from a .txt file and pasting them over lines in another .txt file

Hello Everyone, I am very green when it comes to AutoIT, I have recently started using it to automate a job that i perform using MS Excel and that is working great. Recently I have been faced with a challenge I which i need to copy a specific set of lines from one .txt file and past them, overwriting a specific set of lines in a different .txt file. I honestly have no clue how I can copy the specified lines and transfer them. What functions / commands could I use and how could I lay them out I AutoIT? Any and all help will be appreciated. Thanks! Kruxe
6. ## Click IE object by text

Hey there! I am having a problem with clicking a button in IE. As you can see in the code, there would be a class name to click it, but since this button exists several times with exactly the same code, I can only use the "Noch nicht veröffentlicht" to separate it from the others. But this part is just pure text without any classification. "<div class="checkmark" data-v-1e5b1f70=""><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 16 16" data-v-1e5b1f70=""><circle cx="8" cy="8" r="8" data-v-1e5b1f70="" /></svg></div>Noch nicht veröffentlicht" I was trying to click it with: #include <IE.au3> local $oNNVs = _IEFormGetCollection($oIE2) For $oNNV in$oNNVs If String($oNNV.innertext) = "Noch nicht veröffentlicht" Then _IEAction($oNNV, "click") EndIf Next and: $inputs =$oIE2.document.getElementsByTagName("div") For $input In$inputs If $input.innertext == "Noch nicht veröffentlicht" then$input.click() EndIf Next But nothing seems to work. Thanks for the help!

14. ## Text over movie

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.
15. ## How to keep the address in a text file?

Hello. On page there is mail address. How to keep in a text file this address? It is page and email https://alpari.com/ info@alpari.com
16. ## How to read the text of an active chrome windows?

Hey. I requested help about how to get a value from a text in a variable. Now i know how to do that. But i learned with the command FileRead. Now i whould like to know how to replace the command : FileRead('Dossier.txt') The purpose is to read a webpage text. To find some value inside. Btw i tryed to play with WindowsInfo.au3 but i dont got much thing.
17. ## Scale text to window

I'm trying to create a simple clock widget that automatically scales the text to the size of the window. I came up with the following method, but it doesn't work as well as I'd like. It especially has trouble scaling to the width of the window for some reason (in the example, try resizing the window to be narrow and tall). Does anyone have a better method? #include <Misc.au3> #include <WinAPIConv.au3> #include <GUIConstants.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Global $_FONT_FAMILY = 'Arial',$_LB_TEXT Main() Func Main() _GDIPlus_Startup() Local $hGUI GUIRegisterMsg($WM_SIZE, WM_SIZE) $hGUI = GUICreate('', 300, 100, Default, Default,$WS_OVERLAPPEDWINDOW, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)) $_LB_TEXT = GUICtrlCreateLabel('This is a string', 0, 0, 300, 100, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont($_LB_TEXT, _MeasureString($hGUI, GUICtrlRead($_LB_TEXT), $_FONT_FAMILY), 0, 0,$_FONT_FAMILY, 5) GUISetState() Local $iGM While 1$iGM = GUIGetMsg() Switch $iGM Case$GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GDIPlus_Shutdown() EndFunc Func WM_SIZE($hWnd,$iMsg, $wParam,$lParam) GUICtrlSetFont($_LB_TEXT, _MeasureString($hWnd, GUICtrlRead($_LB_TEXT),$_FONT_FAMILY), 0, 0, $_FONT_FAMILY, 5) EndFunc Func _MeasureString($hWnd, $sString,$sFont = 'Arial') Local $iError,$aSize, $hGraphic,$hFormat, $hFamily,$tLayout, $iFontSize,$hFont, $aInfo If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf $aSize = WinGetClientSize($hWnd) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $hFormat = _GDIPlus_StringFormatCreate()$hFamily = _GDIPlus_FontFamilyCreate($sFont)$tLayout = _GDIPlus_RectFCreate(0, 0, $aSize[0],$aSize[1]) $iFontSize = 0 Do If Not$hFamily Then $iError = 1$iFontSize = 10 ExitLoop EndIf $iFontSize += 1$hFont = _GDIPlus_FontCreate($hFamily,$iFontSize, 0) $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString,$hFont, $tLayout,$hFormat) _GDIPlus_FontDispose($hFont) If$aInfo[1] = 0 Then ExitLoop Until DllStructGetData($aInfo[0], 3) >=$aSize[0] Or DllStructGetData($aInfo[0], 4) >=$aSize[1] $iFontSize -= 1 _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) Return SetError($iError, 0,$iFontSize) EndFunc
18. ## Trade Signal - extract information

Hi! I want to get the signal in this website: https://binary-signal.com/pt/chart/eurusd I have tried using _IEBodyReadText and some _StringBetween. What happens is that the text are being update every tick and _IEBodyReadText doesn't. To perform the update I used _IEAction($oIE, "refresh") but it's not good because the website block me after some time due too many requests.. Is there any other way to get this text every tick? PS: The text I want to get is WAIT, CALL or PUT. Here is the code: global$oIE = _IECreate ('https://binary-signal.com/pt/chart/eurusd', 0, 1 , 1 , 0) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ($sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') ;MsgBox ( 0, "asf", $result[0])$espera=StringInStr($result[0], "WAIT")$compra=StringInStr($result[0], "CALL")$venda=StringInStr($result[0], "PUT") ;MsgBox($MB_SYSTEMMODAL, "", $espera)$n=0 $c=0 Captar() Func Captar() ;_IENavigate($oIE, "https://binary-signal.com/pt/chart/eurusd") ;MsgBox($MB_SYSTEMMODAL, "",$n) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ($sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') If (Not $compra=0) And$n=0 Then MsgBox($MB_SYSTEMMODAL, "", "COMPRE")$n=1 $c=$c+1 ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not$venda=0) And $n=0 Then MsgBox($MB_SYSTEMMODAL, "", "VENDA") $c=$c+1 $n=1 ;_IEAction($oIE, "refresh") ;MsgBox($MB_SYSTEMMODAL, "",$n) Sleep(60000) Captar() ElseIf (Not $venda=0) And$n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada")$n=1 ;MsgBox($MB_SYSTEMMODAL, "",$n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not$venda=0) And $n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada") $n=1 ;MsgBox($MB_SYSTEMMODAL, "", $n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() Else ;MsgBox("", "", "ESPERE") $n=0 Sleep(1000) ;_IEAction($oIE, "refresh") Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ($sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') Captar() EndIf EndFunc

22. ## Can't get text items from ControlTreeView

I'm trying to add a bit of functionality to the FastStone File Rename dialog. I can access every control that I need to except the one that contains the files to be renamed. If I do some exploring in a vbScript shell I get :c = "TTntTreeView.UnicodeClass1" :?aut.ControlTreeView(win,"",c,"GetItemCount","","") 5 You can see that the treeview control reports having five items, which is the number displayed. If I manually select (mouse) item #3 I can see the result by :?aut.ControlTreeView(win,"",c,"GetSelected","1","") #3 But I do not know how to get the text for the selected item. If "#3" is the item reference then I should be able to :?aut.ControlTreeView(win,"",c,"GetText","1","#3") or :?aut.ControlTreeView(win,"",c,"GetText","1","#3") if I go strictly by the help file, but it returns nothing. :?aut.ControlTreeView(win,"",c,"Exists","","3") 1 So it appears that item 3 exists, but :?aut.ControlTreeView(win,"",c,"GetText","","3") does not have any text??? :?aut.ControlTreeView(win,"",c,"Exists","","9") 1 and it also appears item 9 exists (it does not) :?aut.ControlTreeView(win,"",c,"Select","","") 1 causes the first item to be selected, as does :?aut.ControlTreeView(win,"",c,"Select","","3") 1 Here is the output from the Window Info tool >>>> Window <<<< Title: Batch Image Convert / Rename Class: TBatchConvert Position: 501, 83 Size: 760, 520 Style: 0x16CD0000 ExStyle: 0x00010100 Handle: 0x0000000001950796 >>>> Control <<<< Class: TTntTreeView.UnicodeClass Instance: 1 ClassnameNN: TTntTreeView.UnicodeClass1 Name: Advanced (Class): [CLASS:TTntTreeView.UnicodeClass; INSTANCE:1] ID: 37030040 Text: Position: 354, 79 Size: 378, 188 ControlClick Coords: 108, 86 Style: 0x54010039 ExStyle: 0x00000200 Handle: 0x0000000002350898 >>>> Mouse <<<< Position: 970, 279 Cursor ID: 0 Color: 0xE1E1E1 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Batch Rename ... D:\temp\picsave\ Images + Videos (*.jpg;*.jpe;*.jpeg;*.bmp;*.gif;*.tif;*.tiff;*.cur;*.ico;*.png;*.pcx;*.jp2;*.j2k;*.tga;*.ppm;*.wmf;*.psd;*.crw;*.nef;*.cr2;*.orf;*.raf;*.dng;*.mrw;*.pef;*.srf;*.arw;*.rw2;*.x3f;*.sr2;*.srw;*.nrw;*.rwl;*.eps;*.avi;*.mpeg;*.mpg;*.wmv;*.mov;*.mp4;*.mts;*.mkv;*.m4v) Search and Replace Use Filename Template No Sort Clear Remove Add All Add Preview Close Rename No Change ?

I am trying to identify the window based on the window title and text. The title will be the "erwin DM - filename" It is working till date, but some operating systems our application is displaying window as "erwin DM - [filename]" I tried "erwin DM - *filename*" But this regular expression is not working. Any suggestion? $sModelFile = "C:\Users\Administrator\Documents\My Models\eMovies.erwin"$wdModel = _WinWaitActivate1("erwin DM - "&FileNameOnly($sModelFile),"") Func _WinWaitActivate1($title,$text,$timeout=0);Will Return the window Handler Logging("Waiting for "&$title&":"&$text) $dHandle = WinWait($title,$text,$timeout) if not ($dHandle = 0) then If Not WinActive($title,$text) Then WinActivate($title,$text) return WinWaitActive($title,$text,$timeout) Else Logging("Timeout occured while waiting for the window...") Exit EndIf EndFunc Func FileNameOnly($sFilePath) Local$sDrive = "", $sDir = "",$sFileName = "", $sExtension = "" Local$aPathSplit = _PathSplit($sFilePath,$sDrive, $sDir,$sFileName, $sExtension) ;_ArrayDisplay($aPathSplit, "_PathSplit of " & @ScriptFullPath) return $sFileName EndFunc 24. ## Not able to retrieve value from GuiCtrlcreateinput() Hello Guys this is my gui and i need the numeric value typed in the highlighted inputbox. if this value is greater than 1 i need to perform some operations \ Here is the summary about that field which i got from wininfo tool i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... here i am using the valu present in the field can you guys tell me what's wrong??? or how can i get that value? My_GUI.au3 25. ## TTS Text-to-Speech to .wav file using SAPI This small UDF helps you save any text to speech to a .wav file. UDF: #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #INDEX# ======================================================================================================================= ; Title .........: _TTStoWav() ; AutoIt Version : 3.3.14.2 ; Language ......: English ; Author(s) .....: natedog102 ; Modifiers .....: ; Forum link ....: https://www.autoitscript.com/forum/topic/191573-tts-text-to-speech-to-wav-file-using-sapi/ ; Description ...: TTS to .wav file using SAPI ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _TTStoWav ; Description ...: TTS to .wav file using SAPI ; Syntax.........: _TTStoWav($sText, $sLocation[,$iRate = 1[, $iVolume = 100]]) ; Parameters ....:$sText - String you want converted to a .wav ; $sLocation - Save location + file name, example: "C:\folder\sample.wav" ;$iRate - TTS speak rate between -10 and 10 ; $iVolume - Volume of the TTS between 0 and 100 ; Return values .: Success - Returns one ; Failure - Returns zero ; Author ........: natedog102 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TTStoWav($sText, $sLocation,$iRate = 1, $iVolume = 100)$oFileStream = ObjCreate("SAPI.SpFileStream") If @error Then Return 0 EndIf $oFileStream.Format.Type = 39$oFileStream.Open($sLocation, 3)$oSpeech = ObjCreate('SAPI.SpVoice') If @error Then Return 0 EndIf $oSpeech.AudioOutputStream =$oFileStream $oSpeech.Rate =$iRate $oSpeech.Volume =$iVolume $oSpeech.Speak($sText, 3) $oSpeech.WaitUntilDone(10000)$oFileStream.Close() Return 1 EndFunc ;==>_TTStoWav And here's example usage: _TTStoWav("This is a test", "C:\folder-must-exist\sample2.wav") I have never made a UDF before so I don't know if I coded it correctly or if I followed all the recommended guidelines. Apologies if I haven't. DOWNLOAD: _TTStoWav.au3
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...