New syntax highlighting file for AutoIt version 3

New syntax highlighting file for AutoIt version 3

4
NewbieNewbie
4

    Jul 03, 2005#1

    I have created a new UE syntax highlighting word file for AutoIt version 3. The improvements to the existing ones available form the UE website are:

    1.  Support for syntax highlighting for the new GUI commands introduced in AutoIt version 3,
    2.  code folding is now implemented,
    3.  AutoIt language syntax is no longer case sensitive (for example "if", "IF" and "If" now all highlight and code fold correctly).

    To implement, copy the syntax below and past into your existing UE wordfile.txt file replacing any existing syntax already in the file for AutoIt. Make sure you change the "/L12" to your language number of choice in the range 01 to 20. Save the updated wordfile, then exit and restart UE.

    To get code folding to work you will need to activate this option in UE: "Advanced menu/ Configuration/General tab/Display options/Enable show-hide lines and code folding".

    This syntax may be treated as a beta. It contains a number of important updates for AutoIt version 3. For improvements please let me know.

    Code: Select all

    /L12"AutoIT 3.00.x Beta" Nocase String Chars = " Line Comment = ; Block Comment On = #cs Block Comment Off = #ce Block Comment On Alt = #comments-start Block Comment Off Alt = #comments-end File Extensions = AU3
    /Delimiters = "'[]%,$(){}=<># 
    /Function String = "%Func ^([a-zA-Z_]*[a-zA-Z_0-9]*(*)^)"
    /Indent Strings SOL = "Case" "Do" "Else" "For" "Func" "If" "Select" "While"
    /Unindent Strings = "Else" "EndFunc" "EndIf" "EndSelect" "Next" "Until" "Wend"
    /Open Fold Strings = "If" "Do" "While" "For" "Func" "Select"
    /Close Fold Strings = "EndIf" "Until" "WEnd" "Next" "EndFunc" "EndSelect"
    
    /C1"Keywords"
    #include
    Byref
    Case ContinueLoop
    Dim Do
    Else ElseIf EndFunc EndIf EndSelect Exit ExitLoop
    For Func
    Global
    If
    Local
    Next
    Opt
    Return ReDim
    Select Step
    Then To
    Until
    Wend While
    
    /C2"Commands"
    Abs ACos AdlibDisable AdlibEnable Asc ASin ATan AutoitSetOption AutoitWinGetTitle AutoitWinSetTitle
    BitAND BitNOT BitOR BitShift BitXOR BlockInput Break
    Call CDTray Chr 
    ClipGet ClipPut ControlClick ControlCommand ControlDisable ControlEnable ControlFocus
    ControlGetFocus ControlGetPos ControlGetText ControlHide ControlMove ControlSend ControlSetText ControlShow Cos
    Dec DirCopy DirCreate DirMove DirRemove DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial
    DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus
    EnvGet EnvSet EnvUpdate Eval Exp
    FileChangeDir FileClose FileCopy FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile
    FileGetAttrib FileGetLongName FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall
    FileMove FileOpen FileOpenDialog FileRead FileReadLine FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder
    FileSetAttrib FileSetTime FileWrite FileWriteLine
    GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu
    GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput
    GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu
    GUICtrlCreateMenuItem GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab
    GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetState
    GUICtrlRead GUICtrlRecvMsg GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor
    GUICtrlSetData GUICtrlSetFont GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing
    GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUISetBkColor GUISetCoord
    GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUIStartGroup GUISwitch
    Hex HotKeySet
    IniDelete IniRead IniWrite InputBox Int IsAdmin IsArray IsDeclared IsFloat IsInt IsNumber IsString
    Log
    MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox
    Number
    PixelCheckSum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessSetPriority ProcessWait ProcessWaitClose
    ProgressOff ProgressOn ProgressSet
    Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAsSet RunWait
    Send SetError ShutDown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt
    StatusbarGetText String StringAddCR StringFormat StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit
    StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower
    StringMid StringReplace StringRight StringSplit StringStripcr StringStripWS StringTrimLeft StringTrimRight StringUpper
    Tan TimerDiff TimerInit ToolTip TrayTip
    UBound URLDownloadToFile
    WinActivate WinActive WinClose WinExists WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos
    WinGetState WinGetText WinGetTitle WinKill WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop
    WinSetState WinSetTitle WinWait WinWaitActive WinWaitClose WinWaitNotActive
    
    /C3"Macro's"
    @AppDataCommonDir @AppDataDir @AutoitVersion
    @CommonFilesDir @Compiled @ComputerName @ComSpec @CR @CRLF
    @DesktopCommonDir @DesktopDir @DesktopHeight @DesktopWidth @DesktopDepth @DesktopRefresh @DocumentsCommonDir
    @error
    @FavoritesCommonDir @FavoritesDir
    @HomeDrive @HomePath @HomeShare @Hour
    @IPAddress1 @IPAddress2 @IPAddress3 @IPAddress4
    @LF @LogonDNSDomain @LogonDomain @LogonServer
    @MDAY @MIN @MON @MyDocumentsDir
    @OSBuild @OSLang @OSServicePack @OSType @OSVersion
    @ProgramFilesDir @ProgramsCommonDir @ProgramsDir
    @ScriptDir @ScriptFullPath @ScriptName @SEC @StartMenuCommonDir @StartMenuDir @StartupCommonDir @StartupDir
    @SW_HIDE @SW_MAXIMIZE @SW_MINIMIZE @SW_RESTORE @SW_SHOW @SW_SHOWDEFAULT @SW_SHOWMAXIMIZED @SW_SHOWMINIMIZED
    @SW_SHOWMINNOACTIVE @SW_SHOWNA @SW_SHOWNOACTIVATE @SW_SHOWNORMAL @SystemDir
    @Tab @TempDir @UserProfileDir
    @UserName
    @WDAY @WindowsDir @WorkingDir
    @YDAY @YEAR
    
    /C4"Constants"
    ALL AddString
    CDROM Check CurrentTab
    closed
    DelString
    EditPaste
    FIXED FindString
    GetCurrentCol GetCurrentLine GetCurrentSelection GetLine GetLineCount GetSelected
    HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HideDropDown
    INVALID IsChecked IsEnabled IsVisible
    NETWORK NOTREADY
    open
    RAMDISK READY REG_BINARY REG_DWORD REG_EXPAND_SZ REG_MULTI_SZ REG_SZ REMOVABLE
    SelectString SetCurrentSelection ShowDropDown
    TabLeft TabRight
    UNKNOWN UnCheck
    
    /C5"Functions/Variables"
    ** $ _
    
    /C6"Send Keys"
    ** ! # ^ +
    '
    }
    {
    ALT ALTDOWN ALTUP APPSKEY ASC
    BACKSPACE BROWSER_BACK BROWSER_FAVORITES BROWSER_FORWARD BROWSER_HOME BROWSER_REFRESH BROWSER_SEARCH
    BROWSER_STOP BS
    CAPSLOCK CTRLBREAK CTRLDOWN CTRLUP
    DELETE DEL DOWN
    END ENTER ESC ESCAPE
    F1 F10 F11 F12 F2 F3 F4 F5 F6 F7 F8 F9
    HOME
    INS INSERT
    LALT LAUNCH_APP1 LAUNCH_APP2 LAUNCH_MAIL LAUNCH_MEDIA LCTRL LEFT LSHIFT LWIN LWINDOWN LWINUP
    MEDIA_NEXT MEDIA_PLAY_PAUSE MEDIA_PREV MEDIA_STOP
    NUMLOCK NUMPAD0 NUMPAD1 NUMPAD2 NUMPAD3 NUMPAD4 NUMPAD5 NUMPAD6 NUMPAD7 NUMPAD8 NUMPAD9
    NUMPADADD NUMPADDIV NUMPADDOT NUMPADENTER NUMPADMULT NUMPADSUB
    PAUSE PGDN PGUP PRINTSCREEN
    RALT RCTRL RIGHT RSHIFT RWIN RWINDOWN RWINUP
    SHIFTDOWN SHIFTUP SLEEP SPACE
    TAB
    UP
    VOLUME_DOWN VOLUME_MUTE VOLUME_UP
    
    /C7"Operators"
    &
    *
    +
    -
    /
    <
    =
    >
    AND
    NOT
    OR
    ^
    
    /C8"Separs"
    [
    ]
    (
    )
    ,
    v
    

    tatwo
    tatwo

      Jul 03, 2005#2

      Will this work for autohotkey syntax (superset of AutoIT 3)?

      4
      NewbieNewbie
      4

        Jul 03, 2005#3

        Good question. The short answer is no. AutoHotKey is a different product with different syntax and commands although of course some of the syntax is in common to both AutoIt and AutoHotKey. Also, the file extensions are different, .au3 for AutoIt3 and .ahk for AutoHotKey.

        Having said that, setting up a syntax highlighting file (wordfile in UltraEdit speak) is fairly easy. So an AutoHotKey user could do it easily following the examples for other languages provided on the UltraEdit website. It's then just a matter of testing it and submitting to IDM for listing on the UltraEdit website. Any takers out there.  :?:   It's something that might even tempt me if there's enough interest.

        tatwo
        tatwo

          Jul 03, 2005#4

          Seems that AutoHotKey syntax coloring for UltraEdit is already available .. see this thread ..

          p.s. ..

          even better, the files are included in the AutoHotKey installation .. look in AutoHotKey\Extras folder > Editors\UltraEdit.

          4
          NewbieNewbie
          4

            Jul 03, 2005#5

            dragonfly wrote: p.s. ..

            even better, the files are included in the AutoHotKey installation .. look in AutoHotKey\Extras folder > Editors\UltraEdit.
            Ah yes, good work! That will save us a bit of work.

            Just one thing though. The AutoHotKey syntax file is for version 10 of UltraEdit, not version 11. If you want code folding implemented you will need to add a couple of lines to your UltraEdit wordfile.text file. Immediately before the AutoHotKey line '/C1"CommandNames"' add the following two lines:

            Code: Select all

            /Open Fold Strings = "{"
            /Close Fold Strings = "}"
            
            Plus any other syntax that you want to invoke code folding for.