Search the Community
Showing results for tags 'SciTE'.
-
Hello, I'm using SciTE and AutoIt since 2 weeks at work. Our current security measures here doesn't allow users to have their main accounts Admin on the computer. When I want to do something that requires elevation, I need to try to execute it, wait for Windows to ask for elevation and enter my admin login/pass. For most cases, it's working pretty properly, but I think this is doing a mess with SciTE. As you could see in the title, abbreviations aren't working at all, I even tried to fully uninstall AutoIt and SciTE and reinstall it properly. The abbreviations actually are detected (highlighted in red) but pressing space literally does nothing. Each time, I end with some files in my Program Files, and some in the Admin Account AppData. Nothing in my regular user AppData (seems fair). In the Program Files, it seems to miss some files : I found "Run AutoIt3/SciTE check" under "Other Tools" inside "SciTE Config" and this is what I get : ****************************************************************************************************************************************** * HKCR\.au3 Default : AutoIt3Script * HKLM\SOFTWARE\Classes\.au3\ShellNew: C:\windows\SHELLNEW\Template.au3 (File Exists) * HKCR\.au3 ShellNew : C:\windows\SHELLNEW\Template.au3 (File Exists) ****************************************************************************************************************************************** * Explorer shell options: * HKCR\AutoIt3Script\shell: * => Default Action:Open * Compile => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l" * Compile with Options => Command:"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /ShowGui /in "%l" * CompileX64 => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe_x64.exe" /in "%l" * CompileX86 => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l" * Edit => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1" * Open => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1" * Run => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %* * RunX64 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %* * RunX86 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %* ****************************************************************************************************************************************** * User SciTE info: * Portable:C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig: * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Au3Stripper * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\AutoIt3Wrapper * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\CodeWizard * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\SciTE Jump * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\SciTEConfig * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Tidy * File missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Aabbrev.properties * File missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\au3abbrev.properties * No SciTEUSer.properties yet ****************************************************************************************************************************************** All those "missing files/folders" are inside the Admin AppData folder, except SciTE Jump. When I copy them, I still have those lines : * User SciTE info: * Portable:C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig: * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\SciTE Jump * No SciTEUSer.properties yet I found this post : And the result of Jos's script is : >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\MyUsername\Desktop\testJos.au3" /UserParams +>11:46:18 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0) Keyboard:0000040C OS:WIN_10/2009 CPU:X64 OS:X64 Environment(Language:040C) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.16.1) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\MyUsername\Desktop\testJos.au3 +>11:46:19 AU3Check ended.rc:0 >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\MyUsername\Desktop\testJos.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. -->:266060:askproperty:au3.keywords.abbrev <--:266060:macro:stringinfo: a3w a3w2 ael aes aretval as aso au3check aut2exe aut2exedir autoit3 autoit3dir awgt awst ba bi bin binl binm bn bo bre bretval bro bs but bx cc ccl cco cd cdt ce ceil cf cg cgf cgh cgp cgt ch chk cl clv cm cmd cmd2 cmdline cmdlineselect cmdlineselect2 cmdlineswitch cmdlineswitch2 cont1 cont11 cont111 cont2 cont22 cont222 cp cr cr1 cr2 cr3 cr4 cr5 cs csh cst cw cwb cwe cweln cwelns cwes cwg cwln cwlnb cwlng cwlno cwlnr cwo cwr cws dat datbeta datfinal dco dcr dgd dgfs dgl dgse dgsi dgt dll dllc dllo dllsc dllsgd dllsgp dllsgs dllssd dm dma dmd dmg dou dountil dr dretval ds dsf dsl dst eclose edt eg el emax emin ereg erestore err error errval es eu exec ext extval fcd fcl fcnl fco fcs fd fe ffff ffnf fga fgln fgsh fgsi fgsn fgt fgv fi flo fm fo fod for0 for0ub for0ubn for1 for1c for1ub for1ubn fornext fornext2 fr frc frce fread freadb frl fsa fsd fsf fsp fst fun funcont functions funex funex123 funwrap fw fwl fwrite fwriteb gc gcc gcca gccb gcccb gcccm gccco gccda gccdu gcce gccg gccgc gccgr gcci gccico gccla gccli gccm gccmc gccmi gcco gccpi gccpr gccr gccs gcct gccti gcctic gcctv gcctvi gccu gcd gcgh gcgs gchecked gcr gcrlvs gcrm gcs gcsbc gcsco gcscu gcsd gcsf gcsgr gcsi gcsl gcsm gcsoe gcsp gcsr gcss gcsst gcst gcstd gd gdisable genable gfocus ggci ggm ghide grm gs gsa gsbc gsc gscu gsf gsg gsh gshow gsi gsoe gss gsw gunchecked hkcc hkcr hkcu hklm hks hku hnd hsp ib ic icon icondir id ifelse ifelseif iferrc iferrcln iferrmsg iferrmsg2 iferrmsg2ln iferrmsgln iferrset iferrset2 iferrset3 ifextc ifextcln ifthen ig igi igs incl incl1 incll include includedir includeonce inp ir iretval irs irsn isad isar isbin isbo isd isdll isf isfn ishw isi isk ism isn iso isp iss item iw iws lbl lf1 lf2 lf3 lf4 lf5 lvw mb mb2 mbe mbe2 mbe2ln mbeln mbi mbiln mbqn mbqnln mbqy mbqyln mbw mbw2 mbw2ln mbwln mc mcd md men mgc mgp mgs mm more moremsg mu mw nti num oae oaer oas oasr ocr oev oge options pc pcs pe pgc pl poff pon prag prg ps pset psp pw pwc ra rad rael raes raw rd rdm reg reg2 regdat regkey regval rek result retseterr retval rev rnd rr rwa rwael rwaes rwr sacr say sbgt scite scitedir sco sd se selectcase selectloop selfdelete ser setupgui sex sexec sexecw sf sia sian siascii sid sif sii sil sio sioc sis sisp siu siw sixd ska sl sld slen slower slp slp0 slp1 slp2 slp3 slp4 slp5 sm so sor sp sr srep srex srexr ss sscr ssws sswv stbin stl sto str stri supper switchcase switcherr switchext switchloop tab tab1 tab2 tab3 tab4 tab5 tci tcm tcpa tcpc tcpcs tcpl tcpntip tcpr tcps tcpsd tcpsu td ternary tgm ti tid tigh tigs tigt tisoe tiss tist toolt trayi traym trv tsc tsi tsoe tspi tss tstt tt ub udpb udpcs udpo udpr udpsd udpsu version vretval wa wat wc we wf wgcl wgcp wgcs wgh wgpo wgpr wgs wgte wgti whilew whilewend withe withendwith wk wl wm wma wmau wmsi wsot wss wst wstr ww wwa wwc wwna -->:266060:askproperty:au3.keywords.userabbrev <--:266060:macro:stringinfo: -->:266060:askproperty:keywords7.$(au3) <--:266060:macro:stringinfo:$(au3.keywords.abbrev) $(au3.keywords.userabbrev) ! Filename:\abbrev.properties -------------------------------------------- Filename:\au3UserAbbrev.properties -------------------------------------------- Filename:\au3abbrev.properties -------------------------------------------- +>11:46:19 AutoIt3.exe ended.rc:0 +>11:46:19 AutoIt3Wrapper Finished. So my guess is that SciTE is configured to talk with the Admin AppData and not my non-elevated account, due to the specific install I made. If I am right, how can I configure SciTE to talk with my own AppData ? Is it the purpose of those "SCITE_USERHOME_ variables ? More generally, how can I repair SciTE, make it work properly with such a configuration ? Thanks in advance, Valentin
-
Hi there, I'm new in AutoIt forms and using AutoIt to automate desktop application (able to automate the application normally but facing issue when I've to re-run the application twice within the same script...so need help in this please) here is the steps then followed by the issue in a brief : 1- run application . 2- do some actions (click menus,activate windows,set texts..) 3- close the application. 4- run the application again & access the same controls. 5- open the same windows again (like step 2) 6- perform some validations (by getting texts from some text boxes) 7- close the application again (and repeat 1-7 for 15 times in average ) The issue * all controls are accessible in the first run and actions done successfully on controls (for steps 1-3) BUT from the second run of the application from step-4 it's able to set focus only the main application window. Note: only unique properties used to while mapping the controls. Error that appear in the console : UIAWrappers.au3" (1673) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $x = Int($t[1] + ($t[3] / 2)) $x = Int($t[1] + (^ ERROR Simple spy code of one of the controls that has this strange issue(menubar&view menu Item): ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=XXX;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app") ;main app form xxx _UIA_setVar("oP2","Title:=menuStrip1;controltype:=UIA_MenuBarControlTypeId;class:=WindowsForms10.Window.8.app") ;menuStrip1 ;~ $oUIElement=_UIA_getObjectByFindAll("View.mainwindow", "title:=View;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=View;controltype:=UIA_MenuItemControlTypeId;class:=") ;ControlType:=UIA_MenuItemControlTypeId;classname:=") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click")
- 7 replies
-
- uiawrappers.au3
- simplespy
-
(and 3 more)
Tagged with:
-
When ever you hover your mouse over a native function, user defined function, or an AutoItObject method then you will see the calltip for that function. Click "Like This" if you found this useful! To use this just place the following lua file in the "...AutoIt3\SciTE\lua" directory. MouseHoverCallTips.zip downloads:741 After you have done that then open SciTE and click 'Options' --> 'Open Lua Startup Script' and paste this line after the other lines (may require administrative rights): LoadLuaFile("MouseHoverCallTips.lua") Updates and changes:
-
GrepWin CmdLine Editor to SciTE for those who don't know ! grepWin is a powerful and fast search tool using regular expressions I use it Regularly, so I said to order in AutoIt services more info: https://github.com/stefankueng/grepWin Script does Two Jobs case 1 : Act as editor for grepWin to start SciTE at a specific line in this case for it to work we have to go to the grepWin settings and in the section Editor in Command line to start an editor at a specific line: and give the follow "PathToAutoIt3.exe" "PathToThisScript.au3" |%path%|%line% where "PathToAutoIt3.exe" = the path to AutoIt3.exe "PathToThisScript.au3" = the path of this script |%path%|%line% = as it is main_setting: "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_PlusBar\SciTE\CMD\GrepWinEditor.au3" |%path%|%line% and check the Only one instance CheckBox case 2 : Get the selected txt from SciTE and set as /searchfor: parameter to grepWin a dialog window opens to choose position / setting to search for which is dynamically updated from GrepWinEditor.ini The searchini , an ini file which contains all the values usually passed on the command line - /searchini:"path/to/inifile" [@ScriptDir], [1 Up], [2 Up] section do not change them, they update dynamically every time [@ScriptDir] = @ScriptDir [1 Up] = @ScriptDir & "\..\" [2 Up] = @ScriptDir & "\..\..\" [Default] = The Default setting if no parameter - do not change the Name the rest act as examples and they can change If you want for example after choose the @ScriptDir button to the search started immediately, without having to click the search button first put in the GrepWinEditor.ini in section [@ScriptDir] the entry execute= Command line parameters for grepWin Tested with grepWin-2.0.13_portable -x86 ; https://www.autoitscript.com/forum/topic/210301-grepwineditor/ ;------------------------------------------------------------------------------ ; Title...........: GrepWinEditor.au3 ; Description.....: GrepWin CmdLine Editor to SciTE ;------------------------------------------------------------------------------ #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\ICO\GrepWinEditor.ico #AutoIt3Wrapper_Res_Comment=GrepWin_CmdLine_Editor_Setting: "PathToAutoIt3.exe" "PathToThisScript.au3" |%path%|%line% #AutoIt3Wrapper_Res_Description=GrepWin CmdLine Editor to SciTE #AutoIt3Wrapper_Res_Fileversion=0.0.0.9 #AutoIt3Wrapper_Res_ProductName=GrepWinEditor.au3 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <SendMessage.au3> #include <File.au3> #include <Array.au3> Global $sGrepWinExe = 'D:\i\Pro\grepWin-x86\grepWin_portable.exe' ;ℹ️ Add your path to grepWin <- Global $iShowGuiCtrlTip = 1 ;ℹ️ Set to 0 to hide the GuiCtrlTip <- Global $MyIni = StringTrimRight(@ScriptFullPath, 4) & ".ini" Global $hSciTE_hWnd = WinGetHandle("[CLASS:SciTEWindow]", "") Global $hScite_Editor_hWnd = ControlGetHandle($hSciTE_hWnd, '', '[CLASS:Scintilla; INSTANCE:1]') Global $iParams, $hGrepWin_hWnd $iParams = $CmdLine[0] If Not $iParams Then Global $SciTE_CurrentFile, $SciTE_SelectetTxt $SciTE_SelectetTxt = _SciTE_GetSelection() ConsoleWrite("- $SciTE_CurrentFile=" & $SciTE_CurrentFile & @CRLF) ConsoleWrite("- $SciTE_SelectetTxt=" & $SciTE_SelectetTxt & @CRLF) _GrepWinGui($SciTE_SelectetTxt) Else $iParams = $CmdLine ;~ _TestGUI($CmdLineRaw) _OpenWithSciTE() EndIf Exit ;---------------------------------------------------------------------------------------- Func _SciTE_GetSelection() ;Return the Current SciTE Selection Local $ClipBack, $sClip $SciTE_CurrentFile = "" $ClipBack = ClipGet() ; backup clip data ;get first the $SciTE_CurrentFile ClipPut("<Empty>") ; <Empty> WinMenuSelectItem($hSciTE_hWnd, "", "&File", "Copy Pat&h") Sleep(50) Local $ScriptFullPath = ClipGet() Sleep(50) ConsoleWrite("--- $ScriptFullPath=" & $ScriptFullPath & @CRLF) If FileExists($ScriptFullPath) Then $SciTE_CurrentFile = $ScriptFullPath EndIf ; and then get the $SciTE_SelectetTxt ClipPut("<Empty>") ; <Empty> _SendMessage($hScite_Editor_hWnd, $WM_COPY) Sleep(100) ; * <- $sClip = ClipGet() ClipPut($ClipBack) ; Restore clip data If $sClip = "<Empty>" Then Return SetError(1, 0, "") Else Return $sClip EndIf EndFunc ;==>_SciTE_GetSelection ;---------------------------------------------------------------------------------------- Func _OpenWithSciTE() ;$CmdLineRaw order and send it to SciTE ; ℹ️ important information ; in GrepWin settings in 'Command line to start an editor at a specific line:' give the follow string ; "PathToAutoIt3.exe" "PathToThisScript.au3" |%path%|%line% ; main:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_PlusBar\SciTE\CMD\GrepWinEditor.au3" |%path%|%line% ; ; then '|%path%|%line%' whill transformet to this. and send it to SciTE ; "-open:D:\\i\\Pro\\.AutoIT\\_Test\\_CreateContextMenu\\TrayMsg.au3" -goto:27 Local $aSpl = StringSplit($CmdLineRaw, "|") If $aSpl[0] = 3 Then Local $sCmdStr = '"-open:' & StringReplace($aSpl[2], "\", "\\") & '" -goto:' & $aSpl[3] ConsoleWrite("-- $sCmdStr=" & $sCmdStr & @CRLF) ShellExecute('C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe', $sCmdStr) EndIf EndFunc ;==>_OpenWithSciTE ;---------------------------------------------------------------------------------------- Func _TestGUI($Str) ; Test GUI Local $hGUI = GUICreate("Test GUI", 400, 151, 17, 552, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) GUICtrlCreateInput($Str, 10, 10, 381, 91, $ES_MULTILINE) Local $Button_Ok = GUICtrlCreateButton("OK", 140, 110, 91, 31) GUISetState(@SW_SHOWNORMAL, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Button_Ok Exit Case Else ; EndSwitch WEnd EndFunc ;==>_TestGUI ;---------------------------------------------------------------------------------------- Func _GrepWinCall($CmdSectionName = Default, $sCmdSearchFor = Default, $sCmdRegex = Default, $sCmdSearchPath = Default) ; ℹ️ important information ; https://tools.stefankueng.com/grepWin_cmd.html ; /searchpath:"path" sets the path to search in ; /searchfor:"regex or text" ; /regex:[yes|no] ; /searchini:"path/to/inifile" ; /name:"sectionname" argument ; main: ; /name:"sectionname" /searchini:"path" ; '/name:"Default" /searchini:"D:\i\Pro\.AutoIT\SciTE_PlusBar\SciTE\CMD\GrepWinEditor.ini"' ; chek if GrepWin is open and close it $hGrepWin_hWnd = WinGetHandle("[TITLE:grepWin; CLASS:#32770]") If WinExists($hGrepWin_hWnd) Then ConsoleWrite("! WinExists($hGrepWin_hWnd)" & @CRLF) ConsoleWrite("- WinClose=" & WinClose($hGrepWin_hWnd) & @CRLF) Sleep(100) EndIf Local $sCmdStr If $CmdSectionName = Default Then $CmdSectionName = "Default" If $sCmdSearchFor = Default Then $sCmdSearchFor = "" If $sCmdRegex = Default Then $sCmdRegex = "" If $sCmdSearchPath = Default Then $sCmdSearchPath = "" $sCmdStr = '/name:"' & $CmdSectionName & '"' $sCmdStr &= ' /searchini:"' & $MyIni & '"' If $sCmdSearchPath Then $sCmdStr &= ' /searchpath:"' & $sCmdSearchPath & '"' If Not $sCmdRegex Then $sCmdRegex = 'no' EndIf If $sCmdSearchFor Then $sCmdStr &= ' /searchfor:"' & $sCmdSearchFor & '"' If Not $sCmdRegex Then $sCmdRegex = 'no' EndIf If $sCmdRegex Then $sCmdStr &= ' /regex:"' & $sCmdRegex & '"' ConsoleWrite("- $sCmdStr=" & $sCmdStr & @CRLF) ShellExecute($sGrepWinExe, $sCmdStr) EndFunc ;==>_GrepWinCall ;---------------------------------------------------------------------------------------- Func _GrepWinGui($sCmdSearchFor = "", $sCmdRegex = "", $sCmdSearchPath = "") ; Ini Read Local $MyGui Local $iniFileExists = FileExists($MyIni) Local $index = 0 Local $aArray[1][3] $aArray[0][0] = $index $aArray[0][1] = "Button_ID" $aArray[0][2] = "SearchPath" #Region ===( Checks if .ini not exists then make one. )=== ; ℹ️ important information ; Make the searchini , an ini file which contains all the values usually passed on the command line ; [@ScriptDir], [1 Up], [2 Up] section do not change them, they update dynamically evry time ; [@ScriptDir] = @ScriptDir ; [1 Up] = @ScriptDir & "\..\" ; [2 Up] = @ScriptDir & "\..\..\" ; [Default] = The Default setting if no parameter - do not change the Name ; the rest act as examples and they can change ; https://tools.stefankueng.com/grepWin_cmd.html ; https://github.com/stefankueng/grepWin/releases/tag/2.0.13 If Not $iniFileExists Then ;Open the file for writing (append to the end of a file) and store the handle to a variable. Local $hFileOpen = FileOpen($MyIni, $FO_APPEND + $FO_UTF8_NOBOM) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred while writing the " & @CRLF & $MyIni) Exit EndIf Local $spExamples = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Examples" Local $spInclude = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Include" Local $sTxt = "" $sTxt &= "[@ScriptDir]" & @CRLF $sTxt &= "searchpath=" & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[1 Up]" & @CRLF $sTxt &= "searchpath=" & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[2 Up]" & @CRLF $sTxt &= "searchpath=" & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[Default]" & @CRLF $sTxt &= "searchpath=" & @MyDocumentsDir & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[AutoIt3 -Examples]" & @CRLF $sTxt &= "searchpath=" & $spExamples & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[AutoIt3 -Include]" & @CRLF $sTxt &= "searchpath=" & $spInclude & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "[All]" & @CRLF $sTxt &= "searchpath=" & @MyDocumentsDir & "|" & $spExamples & "|" & $spInclude & "|" & @CRLF $sTxt &= "regex=no" & @CRLF $sTxt &= "filemask=*.au3" & @CRLF $sTxt &= "direxcluderegex=BackUp" & @CRLF $sTxt &= "searchfor=search for All" & @CRLF ;Write data to the file using the handle returned by FileOpen. FileWrite($hFileOpen, $sTxt) ;Close the handle returned by FileOpen. FileClose($hFileOpen) Sleep(200) ShellExecute($MyIni) EndIf #EndRegion ===( Checks if .ini not exists then make one. )=== Local $iPosition, $sScriptDir, $sUp1, $sUp2 If $SciTE_CurrentFile Then $iPosition = StringInStr($SciTE_CurrentFile, "\", 0, -1) $sScriptDir = StringLeft($SciTE_CurrentFile, $iPosition - 1) ConsoleWrite("- $sScriptDir=" & $sScriptDir & @CRLF) $sUp1 = $sScriptDir $sUp2 = $sScriptDir $iPosition = StringInStr($SciTE_CurrentFile, "\", 0, -2) If $iPosition Then $sUp1 = StringLeft($SciTE_CurrentFile, $iPosition - 1) ConsoleWrite("- $sUp1=" & $sUp1 & @CRLF) $iPosition = StringInStr($SciTE_CurrentFile, "\", 0, -3) If $iPosition Then $sUp2 = StringLeft($SciTE_CurrentFile, $iPosition - 1) ConsoleWrite("- $sUp2=" & $sUp2 & @CRLF) EndIf ;prepare the @ScriptDir section IniWrite($MyIni, "@ScriptDir", "searchpath", $sScriptDir) IniWrite($MyIni, "1 Up", "searchpath", $sUp1) IniWrite($MyIni, "2 Up", "searchpath", $sUp2) Sleep(200) ;give some time to IniWrite ;Read the INI section names. This will return a 1 dimensional array. Local $aSections = IniReadSectionNames($MyIni) ;Check if an error occurred. If Not @error Then ;Enumerate through the array displaying the section names. For $i = 1 To $aSections[0] ReDim $aArray[UBound($aArray) + 1][3] $index += 1 $aArray[0][0] = $index ; cnt $aArray[$index][0] = $aSections[$i] $aArray[$index][2] = IniRead($MyIni, $aSections[$i], "searchpath", "default") ;SearchPath Next EndIf Local $iElements, $iOffset $iElements = $aArray[0][0] If $iElements > 0 Then $iOffset = 25 $MyGui = GUICreate("SearchFor: " & $sCmdSearchFor, 300, ($iElements * $iOffset) + 1, @DesktopWidth / 3, @DesktopHeight / 4, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) For $i = 1 To $iElements If $i = 1 Then $aArray[$i][1] = GUICtrlCreateButton($aArray[$i][0], 1, 0, 298, $iOffset, $BS_VCENTER) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") If $iShowGuiCtrlTip Then GUICtrlSetTip(-1, $aArray[$i][2]) Else $aArray[$i][1] = GUICtrlCreateButton($aArray[$i][0], 1, ($i - 1) * $iOffset, 298, $iOffset, $BS_VCENTER) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") If $iShowGuiCtrlTip Then GUICtrlSetTip(-1, $aArray[$i][2]) EndIf Next GUISetState(@SW_SHOW, $MyGui) ;~ _ArrayDisplay($aArray) Local $ID, $sSectionName While 1 $ID = GUIGetMsg() Switch $ID Case $GUI_EVENT_CLOSE Exit Case $aArray[1][1] To $aArray[$aArray[0][0]][1] $sSectionName = $aArray[$ID - 2][0] ConsoleWrite("- $sSectionName=" & $sSectionName & @CRLF) _GrepWinCall($sSectionName, $sCmdSearchFor, $sCmdRegex, $sCmdSearchPath) ExitLoop Case Else ; EndSwitch WEnd GUIDelete($MyGui) EndIf EndFunc ;==>_GrepWinGui ;---------------------------------------------------------------------------------------- Please, leave your comments and experiences here. thank you very much !
-
SciTE PlusBar a attached Menu bar for SciTE Version 1.0.0.32 SciTE_PlusBar.zip Please, leave your comments and experiences here Thanks !
-
Add All open folder & some extra as contex menu in SaveFileDlg & OpenFileDlg of SciTE Adds the ability to quickly select one of the open folders or one of those you use regularly. as a destination to save the file To test, open a few folders in the background and then select >File >Save As... to SciTE First add your favorite folders on line 58, 59, you can put more, but above line 60 $OpenFolders[0][0] = UBound($OpenFolders) - 1 The number on the front "002|D:\i\Pro\.AutoIT" doesn't matter, but need to have it Thanks to @Lepes suggestion for _WinApi_GetParent function, so that only the SciTE dialogue is caught. ; https://www.autoitscript.com/forum/topic/210165-active_savefiledlg/ ;---------------------------------------------------------------------------------------- ; Title...........: Active_SaveFileDlg.au3 ; Description.....: Add All open folder & some extra as contex menu in SaveFileDlg & OpenFileDlg of SciTE ; AutoIt Version..: 3.3.16.1 Author: ioa747 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;~ #NoTrayIcon #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <WinAPISysWin.au3> #include <Misc.au3> #include <Array.au3> Global $hGUI, $hDlgWnd, $hScite If _Singleton(@ScriptName, 1) = 0 Then Exit ; to avoid running it multiple times! While WinExists("[CLASS:SciTEWindow]") $hScite = WinGetHandle("[CLASS:SciTEWindow]") If WinExists("[TITLE:Save File; CLASS:#32770]") Then ; ------------ Save File $hDlgWnd = WinGetHandle("[TITLE:Save File; CLASS:#32770]") _CallFoldersGUI("Save") ElseIf WinExists("[TITLE:Open File; CLASS:#32770]") Then ; -------- Open File $hDlgWnd = WinGetHandle("[TITLE:Open File; CLASS:#32770]") _CallFoldersGUI("Open") EndIf Sleep(500) WEnd Exit ;---------------------------------------------------------------------------------------- Func _CallFoldersGUI($sDlgTitle) If _WinAPI_GetParent($hDlgWnd) = $hScite Then _FoldersGUI($sDlgTitle) While WinActive($hDlgWnd) ; Loop While win exits. Sleep(500) WEnd GUIDelete($hGUI) Else Return EndIf EndFunc ;==>_CallFoldersGUI ;---------------------------------------------------------------------------------------- Func _FoldersGUI($sDlgTitle) $hGUI = GUICreate("MyGUI", 40, 40, -50, -50, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_NOACTIVATE), $hDlgWnd) Local $idDummy = GUICtrlCreateDummy() Local $idButton = GUICtrlCreateButton("contex button", 0, 0, 40, 40, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", -68) Local $idContext = GUICtrlCreateContextMenu($idButton) Local $OpenFolders = _EnumAllOpenFolder() ; Add some extra folder (the numbers on the front don't matter) _ArrayInsert($OpenFolders, 1, "000|") ; separator _ArrayInsert($OpenFolders, 1, "001|D:\i\Pro\.AutoIT\_Test\005_Test") ; * <--------- Fav1 folder (get one of your own) _ArrayInsert($OpenFolders, 1, "002|D:\i\Pro\.AutoIT") ; * <------------------------ Fav2 folder (get one of your own) $OpenFolders[0][0] = UBound($OpenFolders) - 1 For $i = 1 To $OpenFolders[0][0] GUICtrlCreateMenuItem($OpenFolders[$i][1], $idContext) Next Local $Wpos = WinGetPos($hDlgWnd) ;ConsoleWrite("$Wpos " & $Wpos[0] & "; " & $Wpos[1] & "; " & $Wpos[2] & "; " & $Wpos[3] & @CRLF) Local $aOfset[2] ;$aOfset[0]=X ;$aOfset[1]=Y If $sDlgTitle = "Save" Then $aOfset[0] = 270 $aOfset[1] = 55 ElseIf $sDlgTitle = "Open" Then $aOfset[0] = 270 $aOfset[1] = 50 EndIf GUISetState(@SW_SHOW, $hGUI) WinMove($hGUI, "", $Wpos[0] + $Wpos[2] - $aOfset[0], $Wpos[1] + $Wpos[3] - $aOfset[1]) Local $idMsg While WinExists($hDlgWnd) $Wpos = WinGetPos($hDlgWnd) WinMove($hGUI, "", $Wpos[0] + $Wpos[2] - $aOfset[0], $Wpos[1] + $Wpos[3] - $aOfset[1]) $idMsg = GUIGetMsg() Switch $idMsg Case 6 To $OpenFolders[0][0] + 6 ;ConsoleWrite($OpenFolders[$idMsg - 5][1] & @CRLF) WinActivate($hDlgWnd) If $sDlgTitle = "Save" Then ControlCommand($hDlgWnd, "", "ToolbarWindow324", "SendCommandID", 1280) ControlSetText($hDlgWnd, "", "Edit2", $OpenFolders[$idMsg - 5][1]) ControlSend($hDlgWnd, "", "Edit2", "{ENTER}") ElseIf $sDlgTitle = "Open" Then ControlCommand($hDlgWnd, "", "ToolbarWindow323", "SendCommandID", 1280) ControlSetText($hDlgWnd, "", "Edit2", $OpenFolders[$idMsg - 5][1]) ControlSend($hDlgWnd, "", "Edit2", "{ENTER}") EndIf Case $idButton GUICtrlSendToDummy($idDummy) Case $idDummy MouseClick("right") ;ExitLoop EndSwitch Sleep(10) WEnd GUIDelete($hGUI) Return EndFunc ;==>_FoldersGUI ;---------------------------------------------------------------------------------------- Func _EnumAllOpenFolder() ; enumerating all open folders Local $oShell = ObjCreate("Shell.Application") Local $sPath, $index = 0 Local $aArray[$oShell.Windows.Count + 1][2] = [["hWnd", "Path"]] For $oWin In $oShell.Windows $index += 1 $aArray[0][0] = $index $sPath = StringTrimLeft($oWin.LocationURL, 8) ; trim 'file:///' $sPath = StringReplace($sPath, "/", "\") $sPath = _UnicodeURLDecode($sPath) $aArray[$index][0] = HWnd($oWin.HWND) $aArray[$index][1] = $sPath Next Return $aArray EndFunc ;==>_EnumAllOpenFolder ;---------------------------------------------------------------------------------------- Func _UnicodeURLDecode($toDecode) Local $strChar = "", $iOne, $iTwo Local $aryHex = StringSplit($toDecode, "") For $i = 1 To $aryHex[0] If $aryHex[$i] = "%" Then $i = $i + 1 $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $strChar = $strChar & Chr(Dec($iOne & $iTwo)) Else $strChar = $strChar & $aryHex[$i] EndIf Next Local $Process = StringToBinary($strChar) Local $DecodedString = BinaryToString($Process, 4) Return $DecodedString EndFunc ;==>_UnicodeURLDecode ;----------------------------------------------------------------------------------------
-
In a program I'm writing I often have to refer to prior code I've written to get variables, etc. This involves scrolling up/down a lot. Presently I open a second SciTE window and dump the earlier code I'm working on in it, and go back and forth between the 2 SciTE windows but sometimes I edit the wrong window. Is there a way to horizontally split the SciTE window into 2 code views? Much like other programs allow (like Word, Acrobat, etc.)?
- 6 replies
-
- scite
- horizontal split
-
(and 1 more)
Tagged with:
-
Hi! Can someone help me with this? I upgraded from SciTe Edit Lite to full version. Now every time I edit a script it opens on a new SciTe tab, but I want it opens on a new window like before the upgrade. Can someone help me with that? Thanks!!
-
SciTE - Replace TAB with spaces in the open document
BugFix posted a topic in AutoIt Example Scripts
When posting scripts to platforms that use different tab settings (e.g. GitHub), they are ripped from their formatting. Thus, it is better to replace all tabs with spaces in the correct position before posting. I have created the following Lua script for this purpose. It replaces all tabs with the appropriate number of spaces in the document opened in SciTE. By default a tab width of 4 characters is used. But other values are also possible, details about this and the installation and usage are at the beginning of the script. -- TIME_STAMP 2022-05-01 11:28:55 v 0.1 --[[ == Installation == • Store the file to "YOUR-PATH/TabReplaceSciTE.lua" • New entry in your "SciTEUser.properties" (find a free command number, in example is "49" used, and a free shortcut) #49 Replace TAB with spaces command.name.49.*=Replace TAB with spaces command.49.*=dofile "YOUR-PATH/TabReplaceSciTE.lua" command.mode.49.*=subsystem:lua,savebefore:no command.shortcut.49.*=Ctrl+Alt+Shift+R • If your sources has different values for TAB width, you can modify the command call in this script (last line), "TabReplace_FileInSciTE(2)" or "TabReplace_FileInSciTE(8)". Or add a property to your "SciTEUser.properties" to have more flexibility: # The currently used tab.size, which is replaced by spaces # Without this property or with empty value "4" is used. tab.replace.width=2 Then change the last line in this script to: TabReplace_FileInSciTE(props['tab.replace.width']) == Usage == • Open any script. • Hit the shortcut. • In the opened document, all TAB will be replaced by the number of spaces corresponding to the TAB position in the line. ]] ---------------------------------------------------------------------------------------------------- --[[ in...: _line A line of text whose TAB are to be replaced by spaces. .....: _tabsize TAB size in number of characters. If it is omitted, 4 is used. out..: The line, with TAB replaced if necessary, and the number of replacements. ]] ---------------------------------------------------------------------------------------------------- TabReplace_Line = function(_line, _tabsize) if _line:find('^[\r\n]+$') then return _line, 0 end -- only a line break if _line == '' then return _line, 0 end -- only a empty string local posTab = _line:find('\t') if posTab == nil then return _line, 0 end -- no TAB included _tabsize = _tabsize or 4 -- default TAB width local tTab, s, sRep, iLen, sumLen = {}, ' ', '', 0, 0 while posTab ~= nil do -- calculation replacement string, taking into account characters to be inserted iLen = (_tabsize - ((posTab + sumLen -1) % _tabsize)) sumLen = sumLen + iLen -1 -- total length of the replacements sRep = s:rep(iLen) -- create replacement string table.insert(tTab, sRep) -- save to table posTab = _line:find('\t', posTab +1) -- find next TAB end local idx = 0 _line = _line:gsub('\t', function() idx = idx +1 return tTab[idx] end) return _line, idx end ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- --[[ Replaces all TAB in the file currently open in SciTE ]] ---------------------------------------------------------------------------------------------------- TabReplace_FileInSciTE = function(_tabsize) local caret = editor.CurrentPos local fvl = editor.FirstVisibleLine local content = '' if _tabsize == '' then _tabsize = nil end for i=0, editor.LineCount -1 do local line = editor:GetLine(i) line = line or '' line = TabReplace_Line(line, _tabsize) content = content..line end editor:BeginUndoAction() editor:ClearAll() editor:InsertText(0, content) editor:EndUndoAction() editor.CurrentPos = caret editor:SetSel(caret, caret) editor.FirstVisibleLine = fvl end ---------------------------------------------------------------------------------------------------- TabReplace_FileInSciTE(4) -- If required: Change the TAB size here TabReplaceSciTE.lua -
Greetings all, I went looking around for dark themes for SciTE and didn't have much luck. No wish to necro-post, but I found this post -> A dark theme for SciTE but it seems as if things were ended at a single change for AutoIt where I was hoping for a comprehensive dark theme. I currently have a dark desktop in Mint where xed, the terminal emulator, vim, and etcetera do an acceptable job of showing the dark theme. Then I load SciTE and get blinded. To resolve this, I'm currently working on creating a set of lang.properties files that use the Solarized themes (both light and dark). The mechanism is simple enough: I wrote a small Perl program which parsed all the properties files and extracted all the distinct color values. Then I assigned indexes to all the distinct colors, and wrote the colors themselves out to a separate properties file. Next I parsed that and I used the formula for reducing the color palette to fewer colors as a baseline for generating the Solarized light theme - which turned out surprisingly less awful than I would have guessed. Next I generated a color theme where all the colors are reversed for the Solarized dark theme. The result is dark, but the individual source files I look at still need more help (Perl was particularly bad). At this point, it is possible on my computer to switch to either the Solarized light or dark theme with one line of text in my user options file. Now I'm working my way through source-code cleaning up the result. My first stop is completing Perl, but AutoIt is my next stop. I'm happy to put the modified files out there for all to use (if you want them). I'm willing to do all the legwork for all the properties files. The problem is that I'm only familiar with some of the languages that SciTE recognizes (for example - I wouldn't know Baan if it bit me on the butt). I looked all around both the Solarized website and the Scintilla/SciTE website, and I can't find any reference files that can be used to test the colors. Which means that any language I don't understand will get the colors chosen by the algorithm, which is admittedly fairly rough. Which leads me to this post: What would be particularly useful would be code samples in different languages. The more of the style numbers that are touched in that language the better. I don't care if the code is "quality" code, I'm more interested in whether the code snip is properly colorized (for some values of "proper"). I understand that nobody is obligated to help me with "my project". However, I promise that I will do my best with any code snips in any language and I will post the results here. I'm using xed and vim as my templates, so my results will (mostly) resemble results there. I'll post my work here as time progresses, I'll probably have a working version for Perl and AutoIt in the next few days, and I'll do my best with other languages going forward. As I say, I welcome code snips in any language that SciTE colorizes using a properties file. Edit1: Attached is the first Solarized Version. I have only tested this in the default install of SciTE. I'm certain there are going to be differences between the default install and the full version, but I don't yet know what those differences will be. To use this: Detach the zip file. Drop the folder into your profile directory. For example: C:\Users\mrider\Solarized . Open your local options file in SciTE (Options -> Open User Options File). Add the line "import Solarized\SolarDark" (without the quotes) to your file. You can turn the dark theme on and off with a comment character (#) at the beginning of the statement. Enable "Solar Light" theme similarly using "import Solarized\SolarLight". As I say, this doesn't work in the full version, so only use this if you are using the basic version. I'll chase the full version next. Edit2: Attached is the second Solarized Version. This works with the full install of SciTe, but so far I've only tested it with Autoit, Batch Files, and Perl. I'll keep expanding the languages as I go. To use this: Detach the zip file. I had to navigate to "C:\Program Files (x86)\AutoIt3\SciTE" and relax the file permissions to perform the next step. Drop the folder in the SciTE install directory (it doesn't seem to work in one's profile directory). Open your local options file in SciTE (Options -> Open User Options File) - note that this opens the user properties file inside the SciTE directory, not your profile. Add the line "import Solarized\SolarDark" (without the quotes) to your file. You can turn the dark theme on and off with a comment character (#) at the beginning of the statement. Enable "Solar Light" theme similarly using "import Solarized\SolarLight". Solarized_AutoIt_SciTE_version_only.zip Solarized_SciTE_Full_Install.zip
-
I'm trying to use Maps for the first time (Never knew they were available until I read through the release notes) but Scite keeps throwing an error on run about Variable subscript badly formatted. I tried to run the script directly from AutoIT and it also threw an error. I've got the latest 3.3.14.5 and just re-installed Scite. Below is a quick sample that I put together that throws the error in Scite as well as if I run it with the AutoIT Run a script. #include <GUIConstantsEx.au3> Local $mBug[] ;==> Variable subscript badly formatted $mBug.Width = 1100 $mBug.Height = 700 $mBug.GUI = GUICreate("Defect Details", $mBug.Width, $mBug.Height) GUISetState(@SW_SHOW, $mBug.GUI) ;~ $iW = 1100 ;~ $iH = 700 ;~ $hGUI = GUICreate("Defect Details", $iW, $iH) ;~ GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I tried searching the forum for Maps and it's only talking about Beta which I don't have installed. so, what am I doing wrong? Thanks, Mike
-
Hi All, I'm not sure if its possible that I'm trying to achieve, I've looked into https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html and such resources for help, but I cant really find the answer to my question. So upon compiling the script in SciTE, the exe file is given a Description under file Properties>Details. I understand, that one can enter info manually there and it can even implement the version automatically with each compilation. What I'm trying to achieve is to somehow include the "@ScriptName" in the Details>File Description Field. But as I see no variable can be taken after "#" in this case. Do You think its achievable? (Win 10) Much obliged for taking time on reading this. Kind Regards, Brave
- 1 reply
-
- scite
- autoit3wrapper
-
(and 2 more)
Tagged with:
-
In the console under the editor in SciTE: if I add @@ Debug(line,column) then it goes there. if I add "script.au3" (line,column) then it goes there if loaded. if I add "c:\path\script.au3" (line,column) then it loads the file and goes there. ...so far so good. Since I don't know LUA, nor where that is at, my question is ... where is it at ? A silly question because once there I would not know what to do, since I don't know LUA. What I want to achieve is, that since there is something delimiting the script and editor position (li,co), a way to have, let's say: +I like this color and the text that I care for on the left ["c:\path\script.au3" (line,column)] and by having this ["" ()] format ( or anything else, it don't have to be this exact format ), the console would know to jump there. If DClick to jump/goto Line,Column can trigger an external EXE or script, I'd take it from there. If it all can be done from LUA then, I'd do it there. So I don't mind or know how. I just would like that functionality. In a way that don't require a recompile of SciTE. Thanks
-
The block comment (internal: box comment) in SciTE cannot be toggled. I have now created a script that helps. It works with any file type for which the corresponding entries in the properties are created.For toggeling its required to detect, what the user want to do. EDIT 2021-04-14 [v0.10] In the meantime, I have changed and discarded a few things. But in my opinion, the current variant is much easier to handle: Rules for detection: UNSET COMMENT BLOCK - NEW: NONE SELECTION IS REQUIRED! There must exist an comment block near the cursor position (cursor inside the .start line or above). The script detects automatically the "comment.box.start" and the corresponding "comment.box.end" (also if nested) and works until this line. SET COMMENT BLOCK - Some text must selected (at minimum one character) - Starts and/or ends the selection inside of a line, the selection will expanded to full line. - Ends the selection in a line with text, but at line start position so will this line ignored! - Leading and trailing empty lines in selection will ignored! This means that in nested block comments there is at least one more line between two comment.box.start markers. It is recommended to write all block comment settings into "SciTEUser.properties". The setting "comment.box.end.au3" from "SciTEGlobal.properties" is incorrect and must be corrected. comment.box.start.au3=#cs #~ If you want characters or tab in each line of comment block (middle lines), define it here. #~ If TAB should used as box.middle, set it so: comment.box.middle.au3=@Tab #~ "@Tab" is replaced by a tabulator by the script. comment.box.middle.au3= comment.box.end.au3=#ce additional [optional] property: #~ message for comment block set or unset - output/none (1/0), default=0 (none output) #~ e.g.: "++ COMMENT BLOCK - UNSET [line 103-106]" #~ SET : current line numbers of commented text including the lines with .start .end #~ UNSET: current line number(s) of text that was commented comment.box.output=0 Connection to SciTE Search a free command number. Use a Hotkey of your choice. (or use the default shortcut: Ctrl+Shift+Q) If you have declared an option for user lua scripts (e.g.: "Lua.User.Scripts.Path=C:\code\lua"), copy the script to this folder. Otherwise copy it to a folder of your choice and change the path in the command: "dofile". But backslashes in the path must be masked. ("\\"). If your path has spaces don't forgot to encapsulate in string delimiters. # 24 Toggle Block Comment command.name.24.*=Toggle Block Comment command.24.*=dofile $(Lua.User.Scripts.Path)/BlockComment.lua command.mode.24.*=subsystem:lua,savebefore:no command.shortcut.24.*=Ctrl+Alt+F10 Here the lua script: -- TIME_STAMP 2021-04-14 17:56:37 v 0.10 --[[ Toggle Block Comments ©BugFix ( autoit[at]bug-fix.info ) For toggeling its required to detect, what the user want to do. Rules for detection: UNSET COMMENT BLOCK - NEW: NONE SELECTION IS REQUIRED! There must exist an comment block near the cursor position (cursor inside the .start line or above). The script detects automatically the "comment.box.start" and the corresponding "comment.box.end" (also if nested) and works until this line. SET COMMENT BLOCK - Some text must selected (at minimum one character) - Starts and/or ends the selection inside of a line, the selection will expanded to full line. - Ends the selection in a line with text, but at line start position so will this line ignored! - Leading and trailing empty lines in selection will ignored! Properties: It is recommended to write all block comment settings into SciTEUser.properties. The setting "comment.box.end.au3" from "au3.properties" is wrong and must be corrected. comment.box.start.au3=#cs #~ If you want characters or tab in each line of comment block (middle lines), define it here. #~ If TAB should used as box.middle, set it so: comment.box.middle.au3=@Tab #~ "@Tab" is replaced by a tabulator by the script. comment.box.middle.au3= comment.box.end.au3=#ce additional [optional] property: #~ message for comment block set or unset - output/none (1/0), default=0 (none output) #~ e.g.: "++ COMMENT BLOCK - UNSET [line 103-106]" #~ SET : current line numbers of commented text including the lines with .start .end #~ UNSET: current line number(s) of text that was commented comment.box.output=0 Example with AutoIt comment: "SelectionStart" = [S] "SelectionEnd" = [E] ---------------------------------------------------------------------- selection: or or 1 [S]line with some text[E] 1 [S] 1 lin[S]e with some text[E] 2 line with some text[E] or or or 1 [S] 1 [S]line with some text 1 [S] 2 line with some text 2 [E] 2 line with so[E]me text 3 [E] or or 1 [S] 1 [S] ... empty lines 2 line with some text 5 ... empty lines 6 line with some text 6 7 [E] 7 [E] result for all: 1 #cs 2 line with some text 3 #ce ---------------------------------------------------------------------- ]] --[[ History v 0.10 - fixed: If last selected line is also last line in editor, the comment.end was set in this line and so was this line deleted if has toggled. v 0.9 - removed: comment.box.ignore.empty.before/after - was not very usefull - added: detection (and excluding) of leading and/or trailing empty lines in selection v 0.8 - fixed: Problem with selection starts/ends in the middle of a line or ends at the first position of the line with text v 0.7 - added: Automatic detection for comment blocks, NO SELECTION REQUIRED to unset a comment block - added: properties comment.box.ignore.empty.before: if first selected line is empty -- don't include in comment block comment.box.ignore.empty.after: if last selected line is empty -- don't include in comment block comment.box.output: if "1" -- write result of proceeding to console, default is "0" - changed: minimum required selection to start block comment: 1 character v 0.6 - fixed: if selection for uncommenting is wrong, leading/trailing empty line will removed v 0.5 - fixed: the trailing line break from comment.end while uncommenting will not removed v 0.4 - added: detection for uncommenting if selection is wrong (starts/ends in empty line) v 0.3 - project new designed (object syntax) v 0.2 - fixed: missed adding of middle marker in first line ]] local BlockComment = { -- variables ext, -- file extension boxStart, -- property: comment.box.start boxMiddle, -- property: comment.box.middle boxEnd, -- property: comment.box.end bMiddle, -- bool: boxMiddle is defined lenEOL, -- length of line break character(s) from file in editor eol, -- the end of line character(s) in this file msg = {}, -- store line numbers (start, end) for proceeding message selS = {}, -- selection start selE = {}, -- selection end -- selection table fields: -- .pos, -- selection position -- .line, -- selection line number newText, -- the text that replaces the selection -- initialize variables Init = function(self) self.ext = props["FileExt"] self.boxStart = props["comment.box.start."..self.ext] self.boxMiddle = props["comment.box.middle."..self.ext] self.bMiddle = not (self.boxMiddle == "") self.boxEnd = props["comment.box.end."..self.ext] if self.boxMiddle == "@Tab" then self.boxMiddle = "\t" end self.selS = self:SelLineData(editor.SelectionStart) self.selE = self:SelLineData(editor.SelectionEnd) self.lenEOL = self:GetEOL() self.eol = "\n" if self.lenEOL == 2 then self.eol = "\r\n" end self.newText = "" end, -- stores #pos and #line from selection position SelLineData = function(self, _selPos) -- _selPos: editor.SelectionStart or editor.SelectionEnd local t = {} t.pos = _selPos t.line = editor:LineFromPosition(t.pos) return t end, -- returns position from start and end (behind last visible char) of a line LineStartEndPos = function(self, _line) local startP = editor:PositionFromLine(_line) local endP = editor.LineEndPosition[_line] return startP, endP end, -- returns the length of EOL (default) or with "_getMode=true": LF/CRLF -- asking the property "eol.mode.type" is not safe, maybe not set and the global value may differ from the file in the editor GetEOL = function(self, _getMode) -- It is possible that another program makes entries (e.g.: version number) at the beginning of the file.. -- ..with a different EOL mode, therefore the second last line (last line with line break) of the file is checked. local l = editor.LineCount -2 local lenEOL if l < 0 then -- the eol.mode from properties will used instead (but not sure, if exists) local mode = props["eol.mode."..self.ext] -- mode for file type (if declared) if mode == "" then mode = props["eol.mode"] end -- otherwise the global mode if mode == "LF" then lenEOL = 1 else lenEOL = 2 end else local textEnd = editor.LineEndPosition[l] -- pos after last visible character local posLineStart = editor:PositionFromLine(l) -- first pos in line local textLen = textEnd - posLineStart -- pure text length local len = editor:LineLength(l) -- length of line including the line break characters lenEOL = len - textLen -- length of line line break characters end if _getMode then if lenEOL == 1 then return "LF" else return "CRLF" end else return lenEOL end end, -- detects if is/not selection IsSelection = function(self) return (self.selS.pos ~= self.selE.pos) end, -- mask magic characters MaskMagic = function(self, _s) if _s == nil then return "" end return _s:gsub('([%(%)%.%%%+%-%*%?%[%^%$])', '%%%1') end, -- checks if line is empty (has only a line break) LineIsEmpty = function(self, _line) -- _line: number or text from "editor:GetLine" if type(_line) == "string" then return (_line:len() == self.lenEOL) end if _line == nil then return true end local len = editor:LineLength(_line) return (len <= self.lenEOL) end, -- checks if line starts with/has box.start -- detects it also, if nested and middle marker(s) before the start marker LineHasStart = function(self, _line) if self:LineIsEmpty(_line) then return false end if type(_line) == "number" then _line = editor:GetLine(_line) end local pattern if self.boxMiddle == '' then pattern = self:MaskMagic(self.boxStart) else pattern = self:MaskMagic(self.boxMiddle)..'*'..self:MaskMagic(self.boxStart) end local n = _line:find(pattern) return (n ~= nil) end, -- checks if line starts with/has box.end -- detects it also if nested, and middle marker(s) before the end marker LineHasEnd = function(self, _line) if self:LineIsEmpty(_line) then return false end if type(_line) == "number" then _line = editor:GetLine(_line) end local pattern if self.boxMiddle == '' then pattern = self:MaskMagic(self.boxEnd) else pattern = self:MaskMagic(self.boxMiddle)..'*'..self:MaskMagic(self.boxEnd) end local n = _line:find(pattern) return (n ~= nil) end, -- remove middle marker/add line UncommentMiddleLine = function(self, _bMiddle, _text) if _bMiddle then self.newText = self.newText.._text:gsub("^("..self:MaskMagic(self.boxMiddle)..")", "") else self.newText = self.newText.._text end end, -- checks if passed line is last line in editor AND selection ends not at line start position IsLastLine = function(self, _line) return (editor.LineCount == (_line + 1)) and (editor:PositionFromLine(_line) ~= self.selE.pos) end, -- the ternary operator ternary = function(self, _condition, _ifTrue, _ifFalse) if _condition == true then return _ifTrue else return _ifFalse end end, -- creates the text to toggle and replace the selection with it Toggle = function(self) self:Init() local firstVisibleLine = editor.FirstVisibleLine local countNesting, bStart, nStart, text, nLine, replS, replE = 0, false, -1 local lineStart, lineEnd, bLastLine local sStart, sEnd = self:MaskMagic(self.boxStart), self:MaskMagic(self.boxEnd) local sMiddle = self:MaskMagic(self.boxMiddle) local bUsedMiddle = false -- (for uncommenting) check if first line after comment.start, starts with comment.box.middle marker local insertMiddle = "" if self.bMiddle then insertMiddle = self.boxMiddle end -- error check if self.boxStart == "" or self.boxEnd == "" then return print("! ERROR - The comment.box properties for *."..self.ext.." files are missing or incomplete.") end -- check for set comment block if (not self:IsSelection()) then -- none selection - means: Unset CommentBlock -- start unset self.msg.action = 'COMMENT BLOCK - UNSET' nLine = self.selS.line while nLine < editor.LineCount do text = editor:GetLine(nLine) -- line with eol if (not bStart) and self:LineHasStart(text) then -- first line with comment.box.start bStart = true self.msg.starts = nLine nStart = nLine replS = editor:PositionFromLine(nLine) -- save the start position for replacing end if nLine == nStart +1 then -- first line after comment.box.start if self.bMiddle then -- check if comment.box.middle is used, if defined local n = text:find(sMiddle) if n == 1 then bUsedMiddle = true end -- true, if starts with it end end if self:LineIsEmpty(text) then -- do nothing with empty lines, add them only if start was detected before if bStart then self.newText = self.newText..text end -- text is only a line break else if self:LineHasEnd(text) then -- the box.end or a nested box.end countNesting = countNesting -1 -- decrease nesting counter if countNesting == 0 then -- it's the corresponding end position self.newText = self.newText:sub(1, -(self.lenEOL +1)) -- ignore text from this line and delete line break from stored line before replE = editor.LineEndPosition[nLine] -- save the end position (w.o. line break) for replacing self.msg.ends = nLine -2 break -- leave the loop else -- will be treated as middle line (it's a nested comment.box.end) self:UncommentMiddleLine(bUsedMiddle, text) end elseif self:LineHasStart(text) then countNesting = countNesting +1 -- increase nesting counter -- countNesting == 1 it's the real start of block comment --> ignore this line if countNesting > 1 then self:UncommentMiddleLine(bUsedMiddle, text) end -- treat it like a middle line else -- all other cases are middle lines but if not start was detected - ignore this line if bStart then self:UncommentMiddleLine(bUsedMiddle, text) end end end nLine = nLine +1 end if (not bStart) then return print("! ERROR - None comment block starts near the cursor.") -- text near Cursor isn't comment block start marker end else -- set comment block self.msg.action = 'COMMENT BLOCK - SET' if self.selS.line == self.selE.line then -- selection is in one line text = editor:GetLine(self.selS.line) lineStart = editor:PositionFromLine(self.selS.line) lineEnd = editor.LineEndPosition[self.selS.line] + self.lenEOL editor:SetSel(lineStart, lineEnd) -- select all text in line bLastLine = self:IsLastLine(self.selE.line) if bLastLine then self.boxEnd = self.eol..self.boxEnd end self.newText = self.boxStart..self.eol..insertMiddle..text..self.boxEnd..self:ternary(bLastLine, '', self.eol) self.msg.starts = self.selS.line self.msg.ends = self.selS.line +2 else -- as 1.: find the last line with text in selection, possibly blank lines are selected at the end local iLineLastText = -1 for i = self.selE.line, self.selS.line, -1 do if (not self:LineIsEmpty(i)) then iLineLastText = i break end end -- none text selected if iLineLastText == -1 then return print("! ERROR - Only empty lines selected.") end if iLineLastText ~= self.selE.line then self.selE.line = iLineLastText self.selE.pos = editor.LineEndPosition[self.selE.line] end bLastLine = self:IsLastLine(self.selE.line) if bLastLine then self.boxEnd = self.eol..self.boxEnd end for i = self.selS.line, self.selE.line do text = editor:GetLine(i) if i == self.selS.line then -- selection start line if (not self:LineIsEmpty(text)) then lineStart = editor:PositionFromLine(self.selS.line) if lineStart ~= self.selS.pos then self.selS.pos = lineStart editor:SetSel(self.selS.pos, self.selE.pos) end self.newText = self.boxStart..self.eol..insertMiddle..text self.msg.starts = i else -- start line is empty - do nothing end elseif i == self.selE.line then -- selection end line if self.newText == "" then -- the last line is the 1st line with text in selection self.newText = self.boxStart..self.eol self.selS.pos = editor:PositionFromLine(i) self.msg.starts = i end lineStart = editor:PositionFromLine(i) lineEnd = editor.LineEndPosition[i] if lineStart == self.selE.pos then -- selection ends at line start position self.newText = self.newText..self.boxEnd..self.eol -- ignore this line self.msg.ends = i +2 break end if lineEnd == self.selE.pos then -- selection ends behind last visible char self.newText = self.newText..insertMiddle..text..self.boxEnd -- without EOL self.msg.ends = i +2 break end if lineEnd > self.selE.pos then -- selection ends inside the line, line will used self.selE.pos = lineEnd + self.lenEOL -- set selE.pos to line end for correct replacing end self.newText = self.newText..insertMiddle..text..self.boxEnd..self:ternary(bLastLine, '', self.eol) self.msg.ends = i +2 else -- middle lines if (not self:LineIsEmpty(i)) and self.newText == "" then -- may be only empty lines in selection before self.newText = self.boxStart..self.eol self.selS.pos = editor:PositionFromLine(i) self.msg.starts = i end if self.newText ~= "" then self.newText = self.newText..insertMiddle..text end end end editor:SetSel(self.selS.pos, self.selE.pos) end end -- replace the selection with the new toggled text if bStart then editor:SetSel(replS, replE) end -- for uncommenting exists none selection - do it here editor:ReplaceSel(self.newText) -- replace the next editor:SetSel(self.selS.pos,self.selS.pos) -- set the cursor to start position editor.FirstVisibleLine = firstVisibleLine -- make the first visible line visible again if props["comment.box.output"] == "1" then print(string.format('++ %s [line %d-%d]', self.msg.action, self.msg.starts +1, self.msg.ends +1)) end end } BlockComment:Toggle() As far as I know, it is not possible to overwrite SciTE internal hotkeys. In this case "Ctrl+Shift+B" for IDM_BLOCK_COMMENT. Therefore I used the connection shown here. But if overwriting is possible, I would be interested in this solution. BlockComment.lua
-
Hello everyone, I have several signals on the screen that need to be monitored while a program is running. These signals are scattered around an image which is maximized on 4 equal resolution screens - the AutoIT Window Info does not recognize any objects on the program meaning that I'm left with the PixelSearch() and PixelCheckSum() functions to monitor the signals: The signals are as small as a 5x5 pixel area and their coordinates are known. I've been digging around for a while now in this forum about the PixelSearch() and PixelCheckSum() and found some interesting and useful ideas for the use of them. I also came across some other UDF functions like MultiMon(), FastFind(), TtColXY() and the ImageSearch2015 scripts that might be useful for the final output. I don't know if hovering the mouse by using TtColXY() and output its ToolTip() information onto the log file will be faster than using PixelSearch() and/or PixelCheckSum() in a loop for all signals' coordinates. The colours of the signals are below: red - 0x00FF00 (opaque red) green - 0x00FF00 (opaque green) yellow - 0xFFFF00 (opaque yellow) black - 0x000000 (opaque black, default colour) EDIT: The desired output is to monitor and record/log the changes and status of each inside a .txt file or a .csv with the below format: Local Machine Time Signal, Change, delta-t 14:32:07 Signal1 Green - Yellow DELTA-t1 14:34:02 Signal1 Yellow - Red DELTA-t1 14:35:14 Signal2 Yellow - Red DELTA-t2 ... Below is the code I came up with. #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <misc.au3> #include <Date.au3> #include <Array.au3> #include <File.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <WinAPIHObj.au3> Global $program_name, $program_open, $Wname, $tCurrent Global $button_xy[2] = [150, 175] Global $iniColour, $ColourCheck, $NewCheck Global $Red, $Green, $Blue, $Nil Global $sFilePath = @ScriptDir & "\Signals_status.txt" Global $SignalID[10] = ["Signal_1", "Signal_2", "Signal_3", "Signal_4", "Signal_5", "Signal_6", "Signal_7", "Signal_8", "Signal_9", "Signal_10"] $program_name = "Signals.exe" $Wname = "Training Task 3" $program_open = ShellExecute($program_name, @ScriptDir) WinWait($Wname) $iniColour = "0x" & Hex(PixelGetColor($button_xy[0], $button_xy[1]), 6) ;~ $iniChecksum = "0x" & Hex(PixelChecksum($button_xy[0], $button_xy[0] - 5, $button_xy[1], $button_xy[1] + 5), 6) $ColourCheck = "0x" & Hex(PixelChecksum($button_xy[0], $button_xy[0] - 5, $button_xy[1], $button_xy[1] + 5, 1, $Wname), 6) ConsoleWrite(_ColourID($iniColour) & " // " & _ColourID($ColourCheck) & @CRLF) ;~ $ColourCheck = "0x " & Hex(PixelGetColor($button_xy[0], $button_xy[1]), 6) $iniColour = $ColourCheck ;$iniChecksum = $currentCheck Do ;~ While 1 _WindowOnTop() _Close_Notepad() $NewCheck = "0x" & Hex(PixelChecksum($button_xy[0], $button_xy[0] - 5, $button_xy[1], $button_xy[1] + 5, 1, $Wname), 6) $tCurrent = _NowCalc() $LogFile = FileOpen($sFilePath, 2) FileWriteLine($LogFile, "Local Machine Time " & "Signal, " & "Change, " & "delta-t") ;~ $ColourCheck = "0x" & Hex(PixelChecksum($button_xy[0], $button_xy[0] - 5, $button_xy[1], $button_xy[1] + 5, 1, $Wname), 6) If $ColourCheck <> $NewCheck Then ;If there's a colour change from the current colour $ColourCheck = $NewCheck Local $tChange, $NewCheckID, $ColourCheckID, $sLogMsg $tChange = _NowCalc() ConsoleWrite("Colour changed!" & @CRLF) $ColourCheckID = _ColourID($ColourCheck) $NewCheckID = _ColourID($NewCheck) $iTimeDiffh = _DateDiff('h', $tChange, $tCurrent) ; time difference in hours $iTimeDiffm = _DateDiff('n', $tChange, $tCurrent) ; time difference in minutes $iTimeDiffs = _DateDiff('s', $tChange, $tCurrent) ; time difference in seconds $durationCheckSum = $iTimeDiffh & ":" & $iTimeDiffm & ":" & $iTimeDiffs ; Timestamp of the signal until PixelCheckSum $sLogMsg = " " & $SignalID[0] & " " & $ColourCheckID & " - " & $NewCheckID & " " & $durationCheckSum _FileWriteLog($LogFile, $sLogMsg) ElseIf $ColourCheck = $NewCheck Then Local $Colour_check = _ColourID("0x" & Hex(PixelChecksum($button_xy[0], $button_xy[0] - 5, $button_xy[1], $button_xy[1] + 5, 1, $Wname), 6)) ConsoleWrite($tCurrent & " " & $Colour_check & @CRLF) EndIf FileClose($sFilePath) Until Not ProcessExists($program_name) And Not WinExists($Wname) _IsProgramOpen() Func _Close_Notepad() $notepad_open = ProcessExists("notepad.exe") ? ProcessClose("notepad.exe") : ProcessClose("notepad.exe") $notepad_open = WinActive("[CLASS:Notepad]") ? WinClose("[CLASS:Notepad]") : ProcessClose("notepad.exe") EndFunc ;==>_Close_Notepad Func _ColourID($sColour) $Red = Int("0x" & StringRegExpReplace($sColour, "(..)(..)(..)(..)", "\2")) $Green = Int("0x" & StringRegExpReplace($sColour, "(..)(..)(..)(..)", "\3")) $Blue = Int("0x" & StringRegExpReplace($sColour, "(..)(..)(..)(..)", "\4")) If $Green > $Blue And $Red > $Blue And $Green >= 0xB0 And $Red >= 0xB0 Then $sCol = "Yellow" ElseIf $Blue > 0xE0 And $Green > 0xE0 And $Red > 0xE0 Then $sCol = "White" ElseIf $Blue > 0x50 And $Blue = $Green And $Blue = $Red Then $sCol = "Grey" ElseIf $Red > $Green And $Red > $Blue And $Red > 0x70 Then $sCol = "Red" ElseIf $Green > $Red And $Green >= $Blue And $Green > 0x70 Then $sCol = "Green" ElseIf $Blue > $Red And $Blue > $Green And $Blue > 0x70 Then $sCol = "Blue" Else $sCol = "Nil" EndIf Return $sCol EndFunc ;==>_ColourID Func _WindowOnTop() WinActivate($Wname) WinSetOnTop($Wname, "", $WINDOWS_ONTOP) Opt("MouseCoordMode", 0) EndFunc ;==>_WindowOnTop Func _IsProgramOpen() If Not ProcessExists($program_name) And Not WinExists($Wname) Then Break(1) EndIf EndFunc ;==>_IsProgramOpen When the program is running, the window opens in the centre of the screen however, the PixelChecksum function is not looking at the correct area. In addition: 1 - I'm not sure about how to put the message into the log file. 2 - I tested this script but it is not recording the message into the log file. 3 - Is there other way to calculate the duration in these lines? $iTimeDiffh = _DateDiff('h', $tChange, $tCurrent) ; time difference in hours $iTimeDiffm = _DateDiff('n', $tChange, $tCurrent) ; time difference in minutes $iTimeDiffs = _DateDiff('s', $tChange, $tCurrent) ; time difference in seconds $durationCheckSum = $iTimeDiffh & ":" & $iTimeDiffm & ":" & $iTimeDiffs ; Timestamp of the signal until PixelCheckSum $sLogMsg = " " & $SignalID[0] & " " & $ColourCheckID & " - " & $NewCheckID & " " & $durationCheckSum _FileWriteLog($LogFile, $sLogMsg) Thanks in advance!
- 19 replies
-
- pixelchecksum
- pixelsearch
-
(and 3 more)
Tagged with:
-
Scite 3.4.4 Win 10 I click "Help" or press F1, there is no response If I use the file explorer and double click Autoit.chm or Autoit3.chm help opens. There is no dialog to check or uncheck "Always ask before opening this file" when clicking on these files. If you are curious as to why I dont have the latest version, I am creating a back up laptop that has a VERY extensive automation application that I have written over the past 15 years. An extremely potent, powerful, needed function has been deleted in the upgrade of Autoit in recent years that I can not do without. If my main laptop dies, which it almost did, I am in a very bad position. So I bought the exact same laptop and I am "cofiguring" it to work exactly the same as my main laptop. However, this one has been "Upgraded" to Win 10 which I hope is not the problem. Thanks for any help
-
Hello All! i suggest to set default encoding in Scite4 for Autoit 3 to UTF 8 with Bom encoding, format recommended also in Autoit Help. In last editor version, when i open new script, for example Czech characters (č, ř, ž) aren't correct. So when i change Encoding to UTF 8 with Bom from Default Code page property state, everithing seems to be OK. Thank you and sorry for potentialy duplicated content. Fenzik
-
I need to mute an ongoing call on Microsoft teams without activating the window. Teams allows us to mute using shortcut key Ctrl+Shift+m but only when the window is active. # Used set option as ongoing call can be with any person which leads to change in Title Name. AutoItSetOption ( "WinTitleMatchMode", 2 ) # I am not clear with the control ID which will be good to use here and also the key combination of ^M ControlSend ( "Microsoft Teams", "", "[CLASS:Intermediate D3D Window; INSTANCE:1]", "{ctrl down}") Can anyone help...!!!
-
Does SciTE have string or number ids for the recent file menu items? I was hoping to add shortcuts (using the user.shortcuts properties) to the most recent item, but the documentation doesn't list any id's for those items (unless I overlooked?). Also, did anyone else notice that the index listing for the SciTE doc doesn't work properly? It appears it's linking to this: mk:@MSITStore:C:\Program%20Files\AutoIt3\SciTE\Scite4AutoIt3.chm::/SciTEDocumentation.html When it should be this? mk:@MSITStore:C:\Program%20Files\AutoIt3\SciTE\Scite4AutoIt3.chm::/Scitedoc/SciTEDoc.html
-
I have an eof problem in SciTE. I keep gitting this knitsu at the end of the open sesion. Please see below. The file should end at line 1220 but has invisable lines. What am I doing wrong?
-
Edit: A solution was found! Thanks Jos and others who helped me find this: You can have AutoIt run a different "Main" autoit script when you hit F5 instead of the current one, per folder, by doing the following: Run SciTE (might need administrator, depending on how autoit was installed) Options -> global properties (alt o g) Uncomment properties.directory.enable=1 (line 270 in my case) create a file SciTEDirectory.properties in the project's main folder Alternatively, if you don't have admin or don't want to edit the global.properties for whatever reason, you can just skip step 1,2,3 and name it SciTE.properties Put in the file you created command.go.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "NAME OF SCRIPT HERE.au3" /UserParams $(1) $(2) $(3) $(4) Save the file. Now anything you run in that folder or subfolder will run the main script when you hit F5 Using SciTEDirectory.properties effects that folder and subfolders, where as SciTE.properties only effects that folder. Apart from that they work the same Original question: I have a main script, and a bunch of includes / udf's. Almost every single time I edit my includes I hit F5 to run the script, but it runs the include instead. I'm tired of switching back to the main script's tab in SciTE to run it, just to switch back to the include. Is there some kind of #flag or option to set a "main au3 file" so when I hit F5, it will see that and run the main file instead?
-
1/02/2018: Uploaded a new SciTe4AutoIt3.exe v19.102.1901.0 installer. This version contains the bugfix release for SciTE 4.1.2. There has been a major update for Tidy allowing now inline comments without them being shifted to the left by default. See this thread for the total story about the new behavior and the added options ==> SciTE4AutoIt3 v19.102.1901.0 Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 2-1-2019 *** Merged the SciTE v 4.1.2 by Neil Hodgson with our own version of SciTE. (Jos) - Fixed regex issue for Alt+F in AutoItTools.lua - Fixed another regex issue for several functions in AutoItTools.lua - Fixed Header parameters now showing None when none are - Fixed jump to function to also jump to the right Column again. - Restored AutoItTools:Copy_BookMarks() functionality *** Updated AutoIt3Wrapper v19.102.1901.0 (Jos) - 18.703.1808.1 renamed "#AutoIt3Wrapper_Au3Stripper_Stop_OnError" to "#AutoIt3Wrapper_Au3Stripper_OnError" with now as options S,C,F,Stop,Continue,ForceUse - 18.708.1148.1 Added #include <WinAPIFiles.au3> back in the included file list to ensure backward compatibility. - 18.708.1148.2 Added "Tidy_Stop_OnError" support to the AutoIt3Wrapper.INI file. Changed HiDPI settings for Win 10 compatibility. - 18.708.1148.4 Added logic to be able to display Console Output of script that have #RequireAdmin while SciTE runs at normal level. - 18.708.1148.5 Added support to allow to Stop Execution or Restart for scripts with #RequireAdmin while SciTE runs at normal level. It won't hang anymore when you reply No on the UAC and detect the elevated process didn;t start. - 18.708.1148.6 Reverted HiDPI changes made in 18.708.1148.2 as problems are reported. needs investigation. - 18.708.1148.7 Changed check for RequireAdmin AutoIt3Wrapper startup. - 18.708.1148.8 Added #include <APIResConstants.au3> for backwards compatibility with AutoIt3 v3.3.14.x. *** Updated Au3Stripper v19.102.1901.0 (Jos) - 18.708.1148.1 Fixed issue finding variable names on multiline statements - 18.708.1148.2 Added check for ending \ in the AutoIt3Dir, and remove it when there, to avoid duplication of includes. - recompiled with PellesC 6 to make it compatible with WinXP again. *** Updated SciTEConfig v19.102.1901.0 (Jos) - 18.708.1148.1 Update to allow comments in *.SciTEConfig file lines. (JPM) This update includes the updated shemes to allow changing between them. *** Updated Tidy v19.102.1901.0 (Jos) - 18.708.1148.1: Fix bug handling Directivelines ending with continuation character - 18.708.1148.2: Fixed indentation when a "None breaking space"(C2A0) character is used in a UTF file. - 18.708.1148.3: Fix bug when a continuation line starts with +x, where is would add a space between +- and number. - 18.708.9999.x: Rewrite of some internal code to allow inlinecomments to remain at their current position. Details can be found in this post: https://www.autoitscript.com/forum/topic/196221-tidy-major-update-27-10-requesting-help-with-testing/ - 18.708.9999.22: Released to Beta. - 18.708.9999.23: Added option to totally skip commentblocks so now the options are: #Tidy_Parameters=/tcb=0 =>only indent the whole commentblock (default) /tcb or /tcb=1 =>Tidy inside commentblock /tcb=-1 =>leave whole commentbock alone Tidy.INI:#--> Tidy commentblock 0=only indent the whole commentblock (default=0) # 1=Tidy inside commentblock # -1=leave whole commentbock alone Tidy_commentblock=0 - 18.708.9999.24: Added check for ending \ in the AutoIt3Dir and remove it when there. - recompiled with PellesC 6 to make it compatible with WinXP again. -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the online documentation for an overview of all extra's you get with this installer.
- 92 replies
-
If you have every taken the time to set up a nice dark theme for your scite editor, you probably noticed shortly after a small yet really annoying flaw. For what ever reason, scite is not set up to let you change the caret fore color and caret line color per language. This really sucks if say you want to edit a properties file or any of the many other languages that Scite currently is setup to support. Pretty much all the other languages are set as light theme so unless you change the theme for those file types, you end up with something like below where the line color and caret are still using the dark theme colors. Line 3 in the pic: To get around this I came up with the following that seems to work pretty well. Add the following properties to SciteUser.properties file (Options -> Open User Options File). Update colors to your own needs. You can addionally add any other propertys that dont have a lexer language option in the same fashion. # The default values (light themes) will be used for any lexer other than au3 caret.default.fore=#000000 caret.default.line.back=#FFFED8 selection.default.fore=#006000 selection.default.back=#F0A0A8 caret.au3.fore=#FFFFFF caret.au3.line.back=#111111 selection.au3.fore=#C2FFAE selection.au3.back=#f9f9f9 Add the following function to PersonalTools.Lua file. As jos pointed out, the OnStartup covers the filetab switches as well as the startup so only need the one function: function PersonalTools:OnStartup() -- the "and" + "or" keywords are ternary operators here local sLex = self:IsLexer(SCLEX_AU3) and 'au3' or 'default' props['caret.line.back'] = props['caret.' .. sLex .. '.line.back'] props['caret.fore'] = props['caret.' .. sLex .. '.fore'] props['selection.fore'] = props['selection.' .. sLex .. '.fore'] props['selection.back'] = props['selection.' .. sLex .. '.back'] end Last restart SciTE and that should be it. Let me know if you have any issues. Thanks
-
SciTE Hopper : Jump to Any line by one click and many other helpfull functions ! As Ashalshaikh suggested me after leaving me the task to continue >SciTE Hopper, i open a new Topic about it. It will be more easy for futures updates. Many helpfull functions in contextual menu. SciTE Hopper is now multipurpose. • Color Catcher added • BinaryToAu3Kompressor added • TinyAu3Search replaced by StringFinder • RegJumper added • Edit With SciTE added (available in Options) • SpecialCharactersViewer added (available in Tray menu) New Contextual Menu : For a right Click on a function : • Copy function name • Insert a function header • Cut function • Copy function • Delete function • Create a variables List • Remove usseless Blank lines • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay ) • Set AutoIt Code Layout • Remove Comments For entire script : • Create a functions List • Create a variables List • Remove usseless Blank lines • Remove Debug lines ( all lines starting with ConsoleWrite or _ArrayDisplay ) • Set AutoIt Code Layout • Remove Comments • ( Open in SciTE a ) Duplicate of current Script in Temp Dir • ( Open in SciTE a ) Duplicate of current Script in Same Dir • Explore Parent Script Folder • Copy Script name • Copy Script path • Find Unused Functions • Find Unused Variables • Set all functions in alphabetic order.( func headers and regions ( in fact, all lines between functions ) are not supported.) SciTE Editor New Contextual Menu if SciTE Hopper is added ( in Options ) to SciTE Editor : when you made a selection in SciTE Editor you can : • Open a Reg Key in Regedit using RegJumper • Open a Url in your default Browser • Search on google in your default Browser • Search on AutoIt Website in your default Browser Now Can be added to windows start (minimized) Options are available by Tray Menu. A double click on tray icon will open clipboard content to SciTE Editor ( Handy when you have copied some code from your browser ) How to proceed for add SciTE Hopper to SciTE Editor : Run Scite Editor, run Scite Hopper ( compiled! ) go to Options and select Add/Remove to SciTE Tab. then click on Add button and it's done ! Right click on SciTE Editor and choose SciTE Hopper in Contextual Menu for run it when you need it ! Update of 07 Dec 2017 TinyAu3Search is replaced by StringFinder Previous downloads : 1287 Script and compiled version are available in the download section Thanks to Ashalshaikh, Melba23, Th3 MMA, Alzri2, taitel, Manadar, taz742, Yashield, Authenticity, Xenobiologist for their help and asdf8 for his >Includes Helper and azjio for his >FileSearch. Hope it help you and happy Scripting !