i need a script that can replace words in text with other words from a words list
it has to have 2 edit boxes input/output and a button "run"
from word_list.txt it choses which word to replace with. words are separated with commas for multiple choice
; AutoIt GUI Example ; Created: 17/01/2005 - CyberSlug ; Modifed: 05/12/2011 - guinness ; Modifed: 09/06/2014 - mLipok #Region INCLUDE #include <AVIConstants.au3> #include <GuiConstantsEx.au3> #include <TreeViewConstants.au3> #EndRegion INCLUDE #Region GUI GUICreate("Sample GUI", 400, 420) GUISetIcon(@SystemDir & "\mspaint.exe", 0) #EndRegion GUI #Region EDIT GUICtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 10, 380, 175) GUICtrlSetTip(-1, '#Region EDIT') #EndRegion EDIT #Region EDIT2 GUICtrlCreateEdit(@CRLF & " Sample Edit Control", 10, 185, 380, 175) GUICtrlSetTip(-1, '#Region EDIT') #EndRegion EDIT2 #Region BUTTON GUICtrlCreateButton("Sample Button", 10, 360, 100, 30) GUICtrlSetTip(-1, '#Region BUTTON') #EndRegion BUTTON #Region GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() #EndRegion GUI MESSAGE LOOP
I have tried several way sto get this to work to no avail. Any help would be appreciated. #include <ListViewConstants.au3> #include <GuiListView.au3> #include "GuiListViewEx.au3" $idItem = GUICtrlCreateListViewItem($r & " | " & $c & $adoRs.Fields("TransactionAmount").value & " | " & $Timestamp & " | " & _StringProper($adoRs.Fields("Tillid").value) & @CRLF & @CRLF & "Card Number : " & $cardnum & " " , $idListView) ConsoleWrite( "IDITEM" & $idItem) If STRINGLEFT($adoRs.Fields("TransactionAmount").value,1)= "-" Then Consolewrite(" String is Negative" & @CRLF) ;Drops in Here as expected ;GUICtrlSetColor(-1, $COLOR_RED) ; Colour line if item is negative this didn' work $TxC= _GUICtrlListView_SetTextColor($hListView, $CLR_RED) ; I also tried $TxC= _GUICtrlListView_SetTextColor(-1, 0xFF0000) CONSOLEWRITE("TEXTCOLOUR RETURNED " & $TxC & @crlf) ; This is returning True ELSE Consolewrite(" String is NOT Negative" & @CRLF) EndIf
I was looking for a toolbar modification for SciTE and I was checking various versions of SciTE that were available on the internet. They all had some problems for how I wanted to use the editor, so I looked here to see if there were any toolbar modifications for Scite. I found one very old script by YogiBear (Volly) from 2006 that looked promising, though there were issues with it. I decided to see what I could do to modify this script, and make some improvements to it if possible. This script is the result of that work.
It's not perfect and definitely could use some tweaking, but I thought that it had matured enough, and was mostly stable enough to release the updated version.
Minor update to remove all the old Obfuscator directives and replaced them with #Au3Stripper directives instead. I also corrected a minor bug that only showed up for me on one computer I tried this on, and caused the tool bar to crash for others as well.
SciTE toolbar version 2.0
Changed the settings values to use constants instead of 'magic numbers' The icons on the toolbar weren't lining up with the separator characters or with the toolbar GUI because they weren't set with the resize setting for the icons, only for the separators. Changed to using arrays for everything, it makes it a lot easier to loop through the controls Added a line to use an alternate path to the SciTE program, so you can start it using, for example, the portable version instead of installed version for those that don't install AutoIt and/or SciTE4AutoIt3. It will accept a commmand line parameter that points to the SciTE executable. Removed a lot of Global variables by moving the GUI creation and monitoring to the Main function and passing variables from it. I embedded the icon files into the script so that there isn't a separate download of the icon files used here. Saves download time and makes the package smaller. Modification of tools is easier because the icon names, tooltip text, and SciTE command codes are saved in the INI file upon first start up. These can be modified after the script has been run once, even after it's been compiled, by changing the ini file information, you can modify this script to automate it, or you can change it manually in any text editor. The icon files are now using, in just my opinion, better looking icons, after all it's been 7 years and icon files have matured. I have included a file with all of the constants that SciTE uses for its menu commands which comes from the SciTE source file "scite.h", so you can use this file to help you modify the commands that the toolbar works with, by figuring out what each of these values represent in SciTE. The core of the script is pretty much the same, I've just fixed a couple of issues that it had, tweaked a few things, added some new functionality and "prettied" it up a bit.
If anyone has any suggestions as to improvements, bugs/bugfixes, etc. please let me know.
I want to copy just the selected text in an input control and put it to the clipboard, but GuiCtrlRead() always reads all of the text in the control.
In this test code, when I highlight a portion of the left control's text and press ^C, I want to copy just that text to the clipboard; but when I highlight a portion of the right control's text and press ^C, I want to copy all of its text to the clipboard.
#include <Debug.au3> _DebugSetup(@ScriptName & "_debug.txt", False, 2, "") _DebugOut("=============== " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " ====================") #include <GUIConstants.au3> #include <WinAPI.au3> #include <Array.au3> Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Set OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("Event_GUIClose") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index Opt("WinTitleMatchMode", -2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $hWnd_MainWin, $iID_Left, $iID_Right _Main() Func _Main() $hWnd_MainWin = GUICreate("test7", 200, 300) $iID_Left = GUICtrlCreateInput("AAA BBB CCC (get Selected text)", 10, 30, 200, 25) GUICtrlSetOnEvent($iID_Left, "handle_left_btn") $iID_Right = GUICtrlCreateInput("DDD EEE FFF (get All text)", 10, 60, 200, 25) GUICtrlSetOnEvent($iID_Right, "handle_right_btn") Local $aAccelKeys = [["^c", $hWnd_MainWin]] GUISetAccelerators($aAccelKeys) GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose') GUISetState() ; Make everything visible While 1 Sleep(127) WEnd EndFunc ;==>_Main Func handle_CTRL_C_key() ConsoleWrite("+++: handle_CTRL_C_key() entered" & @CRLF) Local $hCtrl, $ctrlID, $control_classname, $text $control_classname = ControlGetFocus($hWnd_MainWin) $hCtrl = ControlGetHandle($hWnd_MainWin, "", $control_classname) $ctrlID = _WinAPI_GetDlgCtrlID($hCtrl) If ($ctrlID = $iID_Left) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied selected text:" & @CRLF & "==>" & $text & "<==" & @CRLF) ElseIf ($ctrlID = $iID_Right) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied all text:" & @CRLF & "==>" & $text & "<==" & @CRLF) EndIf EndFunc ;==>handle_CTRL_C_key Func Event_GUIClose() Exit (99) EndFunc ;==>Event_GUIClose Func handle_left_btn() ConsoleWrite("+++: handle_left_btn() entered" & @CRLF) EndFunc ;==>handle_left_btn Func handle_right_btn() ConsoleWrite("+++: handle_right_btn() entered" & @CRLF) EndFunc ;==>handle_right_btn
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"
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
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
if I go strictly by the help file, but it returns nothing.
So it appears that item 3 exists, but
does not have any text???
and it also appears item 9 exists (it does not)
causes the first item to be selected, as does
Here is the output from the Window Info tool
>>>> Window <<<<
Title: Batch Image Convert / Rename
Position: 501, 83
Size: 760, 520
>>>> Control <<<<
Advanced (Class): [CLASS:TTntTreeView.UnicodeClass; INSTANCE:1]
Position: 354, 79
Size: 378, 188
ControlClick Coords: 108, 86
>>>> Mouse <<<<
Position: 970, 279
Cursor ID: 0
>>>> StatusBar <<<<
>>>> ToolsBar <<<<
>>>> Visible Text <<<<
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