Jump to content
Simpel

SciTE command - look for au3abbreviations

Recommended Posts

Simpel

Hi.

I like to use au3 abbreviations. 'mb2' is often used. But I don't remember them very long. So I wanted to have a little tool looking for it.

This tool is embedded as a command inside SciTE.

First the tool itself:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine.
#AutoIt3Wrapper_Res_Description=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine.
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Simpel
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <File.au3>
 
Global $Ini = @ScriptDir & "\au3abbrev.ini"
Global $au3abbrev =  "PUT IN HERE THE PATH TO\au3abbrev.properties" ; mine is at …\AutoIt3\SciTE\au3abbrev.properties
Global $aGetEntries
Global $sSearch, $sOutput
 
FileCopy($au3abbrev, $Ini, 1) ; make an ini from the properties file
_FileWriteToLine($Ini, 1, "[Dictionary]") ; inserting '[Dictionary]' at first line, to make ini searchable
 
#Region - Look for the right searchstring
If StringLeft($CmdLineRaw, 13) = "/ErrorStdOut " Then ; if not compiled but run with F5 to test
    $sSearch = ClipGet()
ElseIf $CmdLineRaw <> "" Then
    $sSearch = $CmdLineRaw
ElseIf ClipGet() <> "" Then
    $sSearch = ClipGet()
Else
    MsgBox(0, 'Fehler', "Kein Wort zum Suchen gefunden.") ; error
    Exit
EndIf
#EndRegion
 
_GetDefinition()
$sSearch = _Clean($sSearch)
$sOutput = _Search($sSearch)
MsgBox(0, 'au3abbrev.properties', "Ergebnisse für '" & $sSearch & "':" & @CRLF & @CRLF & $sOutput)
Exit
 
#Region - Functions
Func _GetDefinition()
    If FileExists($Ini) Then
        $aGetEntries = IniReadSection($Ini, "Dictionary")
        If @error Then
            MsgBox(0, 'Fehler', "Keine Sektion [Dictionary] gefunden.") ; if inserting of "[Dictionary]" failed
            Exit
        EndIf
    EndIf
EndFunc
 
Func _Search($sInput)
    Local $iCounter = 1
    Local $sfOutput
    For $i = 1 To $aGetEntries[0][0]
        If StringInStr($aGetEntries[$i][1], $sInput) Then ; something is found
            $sfOutput = $sfOutput & _Clean($aGetEntries[$i][0]) & @TAB & _Clean($aGetEntries[$i][1]) & @CRLF & @CRLF
            $iCounter = $iCounter + 1
        EndIf
    Next
    If $sfOutput = "" Then
        $sfOutput = "KEINE ÜBEREINSTIMMUNG" ; no matches found
    EndIf
    Return $sfOutput
EndFunc
 
Func _Clean($sData)
    $sData = StringReplace($sData, "|", "") ; erases "|" because it causes the array to jump to the next entry
    $sData = StringReplace($sData, '"', "") ; erases '"' because it sometimes causes the array to jump to the next entry
    Return $sData
EndFunc
#EndRegion

And now the part at SciTEUser:

# 41 LookAU3Abbrev
command.41.*="H:\_Conrad lokal\Downloads\AutoIt3\_COX\AU3-Abkuerzung.exe" "$(CurrentSelection)"
command.name.41.*=Look Abbrev
command.shortcut.41.*=Ctrl+Shift+Alt+A
command.save.before.41.$(au3)=2

So I mark a regular AutoIt command inside SciTE (with double clicking) and press Ctrl+Shift+Alt+A. I will get a messagebox as answer what abbreviations will contain my sended command. But be careful, not all of these listed abbreviations will expand with space while coding. Abbreviations you want to use have the be declared inside the au3abbrev.keyword.properties(?)

Any suggestions?

Regards, Conrad

Edited by Simpel

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • Jos
      By Jos
      7/8/2018: Uploaded a new SciTe4AutoIt3.exe v18.708.1148.0 installer.
      It has been over a year since the last update of the full SciTE4AutoIt3 installer whch mainly had to do with the fact that Neil was moving toward v4 of SciTE and I wanted to wait for a stable version.
      Any help with testing this version before general release is appreciated.
      Also any feedback is welcome in caseI missed something or suggestions for improvement before releasing.
      ==> SciTE4AutoIt3 v18.708.1148.0
      Enjoy,
      Jos

      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 8-7-2018 *** Merged the SciTE v 4.1.0 by Neil Hodgson with our own version of SciTE. (Jos)     This is a major change from the previous version so ensure you update all files including LUA or else you will get errors!     - SciLexer au3: Fixed issues with nested CommentBlocks not always showing the correct color.     - SciLexer au3: Change any line starting with # and no recognised keyword to be shown with the Pre-Processor in stead of default.     - Changed Shortcut for AU3INFO to Ctrl+Shift+F6.     - Moved the session restore logic for (save.session.advanced=1)into SciTE in stead of LoadSession.lua as that was clearing the recent files list of the last session       when opening a file by double cliking it. This is fixed with this change.       Default remains 0 so when a file is double clicked the last session isn't restored unless you add this to SciTEuser.properties:       "save.session.advanced=1"     - updated Tools.lua replacing [s%] with [ /t] to avoid empty lines being stripped by those functions. (Thanks Enyby) *** Updated AutoIt3Wrapper v18.708.1148.0 (Jos)     - 17.224.935.1 Added /autoit3dir to au3stripper commandline, when provided to AutoIt3Wrapper., to ensure the included files are for the correct AutoIt3 directory     - 17.224.935.2 Added directives:          #AutoIt3Wrapper_Res_CompanyName=          ;Company field          #AutoIt3Wrapper_Res_LegalTrademarks=      ;Trademark field     - 17.224.935.5 Fixed Versioning when files contain backets ->  ()     - 17.224.935.6 Added support for :          #AutoIt3Wrapper_Au3stripper_Stop_OnError=        ;(Y/N) Continue/Stop on Warnings.(Default=N)     - 17.224.935.7 added INI support for:           [Other]            Au3Stripper_Stop_OnError=n     - 17.224.935.10 Minor changes in console messages     - 17.224.935.11 Modifications from JPM:         - add #AutpIt3Wrapper_Res_Cursor_Add         - "clean" a little bit AutoIt3Wrapper.au3 *** Updated Au3Stripper v18.708.1148.0 (Jos)     - 17.224.935.1 Fixed crash when an include file contains longer record than 4096 characters.     - 17.224.935.2 Changed /rsln to replace @ScriptLineNumber in the Master script with "XXX/YYY". XXX is the master script linenumber, YYY is the Merged script linenumber.     - 17.224.935.3 Fixed issue detecting #cs #ce when a space was missing after the directive.     - 17.224.935.4 Changed Close/Open logic for Tracelog to (hopefully) avoid the hardcrash.     - 17.224.935.5 improved speed avoiding rereading include files to determine the max rec len.     - 17.224.935.6 improved speed by re-coding the check for long records.     - 17.224.935.7 Made sure the returncode is the highest from all iterations in stead of the last iteration.     - 17.224.935.8 fix for reported bug: https://www.autoitscript.com/trac/autoit/ticket/3623#comment:4     - 17.224.935.9 added support for #autoit3wrapper_autoit3dir     - 17.224.935.10 Fixed support for #autoit3wrapper_autoit3dir when followed by linecomment                     Stop processing when include file isn't found.     - 18.624.1847.1 strip the leading and trailing double quotes from the autoit3dir directive to avoid an error when they are specified.     - 18.624.1847.2 Fixed Hardcrash in the Include logic     - 18.624.1847.3 Fixed Hardcrash in Func stripping logic by enlarging the base table size     - 18.702.1556.1 Fixed regression bug with the Translate option.     - 18.703.1808.2 Fixed regression bug with the Stripping FUNC logic for the first found FUNC. *** Updated SciTEConfig v18.708.1148.0 (Jos)     - 17.224.935.1 No updates *** Updated Tidy v18.708.1148.0 (Jos)     - 17.224.935.1 Added option  to copy comments from #CS to #CE. Default is to copy the comments.                    Added Tidy Parameters:  /Skip_CE_Comment or /scec will skip this copy action                    Added INI option:                      * * *  Add comment to #CE/#CommentEnd and make it the same as the #CS/CommentStart Comments.                      ce_comment=1     - 17.224.935.2 Fix issue with Copy comments on comment start - end     - 17.224.935.4 Fix another issue with Copy comments on comment start - end -------------------------------------------------------------------------------------------------- ==> 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.
    • sumanth1980
      By sumanth1980
      Here i am wrote a simple lines to install basic applications but when i clicked on one application/program to install it was working fine but when i cancel the program in the middle to install another program it was not working. I am not an expert in this but i want a solution for this ... Can any one help me on this....
      ORG-1.au3
    • Fortitude
      By Fortitude
      Hello!
      I have made a program, that opens a folder, and then store the path ("C:\programFiles\etc") in a variable.
      Then i need to open the command panel as administrator, and write  in the stored path, and some other text.

      Can i somehow instantly copypaste the text i needed, instead of writing in the command panel with the Send commands?
       
      #RequireAdmin #include <MsgBoxConstants.au3> Global Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Global $sFileSelectFolder = FileSelectFolder($sMessage, "") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Nem választottál ki mappát!") Exit EndIf Global $Tiff_path = $sFileSelectFolder & "\TiffChecker_2_32" FileCopy( "C:\TiffChecker_2_32.exe" , $sFileSelectFolder) $CMD = $Tiff_path & " " & $sFileSelectFolder & " /s/d" Run("C:\WINDOWS\system32\cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send($CMD) Sleep(1000) Send("{ENTER}") sleep(1000) MsgBox(0,"Press OK", "Press OK to continue") FileCopy("C:\Tiffchecker.txt", $sFileSelectFolder) Also, how do i close the command panel, when the program is finished? (usually its under 1 second, so after the send i just put a Sleep function there)
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening everyone
      I was trying to insert function header to the functions of my script, but, in the SciTE console, this appears:
      Function or struct definition not found, unable to insert header. @Jos Any suggestion?
      Thanks in advance.

      Best Regards.
    • cheeroke
      By cheeroke
      Hi I am not sure how to call it properly, but for those of you who use SciTE, when you typing built in function and about to pass parameters to it you can see popup with all the ones which can be passed.
      Question: how to create something like that for my own functions?
       
      Thanks
×