Leaderboard
Popular Content
Showing content with the highest reputation on 08/18/2025 in Posts
-
AutoItHelp v3.3.16.1 with external CSS loading
ioa747 reacted to argumentum for a topic
..ok. Back at it I don't like the current CSS as is in the help site. So, I made a "SciTE4AutoIt3 to CSS" script that outputs a nicer "color list" ( to give it a name, not an HTML guy ) #NoTrayIcon #include <StringConstants.au3> #include <SendMessage.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $g_SciTE_hDirector = 0, $g_idMemo = 0, $g_hGUI = 0 If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Or @Compiled Then Exit MsgBox($MB_TOPMOST, @ScriptName, "Run as script from SciTE4AutoIt3", 60) EndIf Exit main() Func main() Local $iW = 700, $iH = 350, $iErr, $sError = "" $g_hGUI = GUICreate(StringTrimRight(@ScriptName, 4), $iW, $iH) $g_idMemo = GUICtrlCreateEdit("", 2, 2, $iW - 4, $iH - 4, $WS_VSCROLL) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) Local $sFilename = _SciTE_ExportScriptToHTML(@ScriptFullPath, @TempDir & "\" & @ScriptName & ".htm") $iErr = @error Switch $iErr Case 1 $sError = 'File not created' Case 2 $sError = 'File did not rename back to original' Case 3 $sError = 'AutoIt Script Editor (SciTE4AutoIt3) is not loaded' EndSwitch Local $sData = FileRead($sFilename) FileDelete($sFilename) Local $sChunk = "", $aChunks = StringSplit($sData, "><") For $n = 1 To UBound($aChunks) - 1 If StringInStr($aChunks[$n], @CRLF & ".S") Then $sChunk = $aChunks[$n] ; this is where the CSS is at ExitLoop EndIf Next $aChunks = StringSplit($sChunk, "}{") Local $aCSS[UBound($aChunks) + 2][3] $aCSS[0][0] = 0 For $n = 2 To UBound($aChunks) - 1 Step 2 ; turn the CSS into an array $aChunks[$n] = StringStripWS(StringReplace($aChunks[$n], @CRLF, " "), 7) If $aChunks[$n] = "" Then ContinueLoop $aCSS[0][0] += 1 $aCSS[$aCSS[0][0]][0] = StringStripWS($aChunks[$n - 1], 8) $aCSS[$aCSS[0][0]][1] = $aChunks[$n] $aCSS[$aCSS[0][0]][2] = _SciTE_Colors_Description($aCSS[$aCSS[0][0]][0]) Next ReDim $aCSS[$aCSS[0][0] + 1][3] ; this builds the CSS values for the script examples in the CHM/HTM file Local $sCSS = '/*** SciTE colors ***/' & @CRLF For $n = 1 To $aCSS[0][0] Switch $aCSS[$n][0] Case "span" $sCSS &= '/* ' & $aCSS[$n][0] & " { " & $aCSS[$n][1] & " } " & $aCSS[$n][2] & " */" & @CRLF Case Else $sCSS &= $aCSS[$n][0] & " { " & _SciTE_Colors_RemoveFontSize($aCSS[$n][1]) & " } /* " & $aCSS[$n][2] & " */" & @CRLF EndSwitch Next $sCSS &= '/*** SciTE colors ***/' & @CRLF ;~ ConsoleWrite($sCSS) MemoWrite($sError = "" ? $sCSS : $sError) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() Return SetError($iErr, 0, $iErr) EndFunc ;==>main ; Write message to memo Func MemoWrite($sMessage = "", $iAppend = 1) GUICtrlSetData($g_idMemo, $sMessage & @CRLF, $iAppend) EndFunc ;==>MemoWrite Func _SciTE_Colors_RemoveFontSize($sStr) Local $n, $sReturn = "", $aArray = StringSplit($sStr, ";") For $n = 1 To UBound($aArray) - 1 If StringStripWS($aArray[$n], 8) = "" Then ContinueLoop If StringInStr($aArray[$n], "font-size") Then ContinueLoop $sReturn &= $aArray[$n] & ";" Next Return $sReturn EndFunc ;==>_SciTE_Colors_RemoveFontSize Func _SciTE_Colors_Description($sS0) Switch $sS0 ; /*** SciTE colors ***/ /** __SciTE4AutoIt3_Dark.SciTEConfig **/ Case ".S0" Return "White space" Case ".S1" Return "Comment line" Case ".S2" Return "Comment block" Case ".S3" Return "Number" Case ".S4" Return "Function" Case ".S5" Return "Keyword" Case ".S6" Return "Macro" Case ".S7" Return "String" Case ".S8" Return "Operator" Case ".S9" Return "Variable" Case ".S10" Return "Send keys in string" Case ".S11" Return "Pre-Processor" Case ".S12" Return "Special" Case ".S13" Return "Abbrev-Expand" Case ".S14" Return "COM Objects" Case ".S15" Return "Standard UDF's" EndSwitch Return "" EndFunc ;==>_SciTE_Colors_Description ; #FUNCTION# ==================================================================================================================== ; @error: ; 1 = File not created ; 2 = File did not rename back to original ; 3 = SciTE is not loaded ; ; Example: ;~ MsgBox(0, @ScriptName, "File: " & _SciTE_ExportScriptToHTML(@ScriptFullPath, @ScriptFullPath & ".htm") & _ ;~ @LF & @LF & 'Error: ' & @error & @LF & 'Extended: ' & @extended) ; =============================================================================================================================== Func _SciTE_ExportScriptToHTML($sSource, $sDestination) Local $iErr = 1, $iExt = 0, $sDestinationTemp = $sDestination & "~" & TimerInit() & ".htm" If Not _SciTE_GetDirector(True) Then Return SetError(3, 0, "") __SciTE_Send_Command(0, _SciTE_GetDirector(False), 'exportashtml:' & StringReplace($sDestinationTemp, '\', '\\')) If FileGetSize($sDestinationTemp) Then $iExt = Int(Not FileMove($sDestinationTemp, $sDestination, 9)) $iErr = ($iExt ? 2 : 0) EndIf Return SetError($iErr, $iExt, ($iErr ? $sDestinationTemp : $sDestination)) EndFunc ;==>_SciTE_ExportScriptToHTML Func _SciTE_GetDirector($bIsReset = False) Local Enum $SCITE_DIRECTOR = 1 If $bIsReset Or Not IsHWnd($g_SciTE_hDirector) Then $g_SciTE_hDirector = WinGetHandle('DirectorExtension') If @error Then $g_SciTE_hDirector = 0 EndIf Return $g_SciTE_hDirector EndFunc ;==>_SciTE_GetDirector Func __SciTE_Send_Command($hWnd, $hSciTE, $sMsg) Local $bReturn = False, $_WM_COPYDATA = 74, $tagCOPYDATASTRUCT = "ulong_ptr dwData;dword cbData;ptr lpData" If Not (StringStripWS($sMsg, $STR_STRIPALL) == '') Then $sMsg = ':' & Dec(StringTrimLeft($hWnd, StringLen('0x'))) & ':' & $sMsg Local Const $tBuffer = DllStructCreate('char cdata[' & StringLen($sMsg) + 1 & ']') DllStructSetData($tBuffer, 'cdata', $sMsg) Local Const $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT) DllStructSetData($tCOPYDATASTRUCT, 'dwData', 0) DllStructSetData($tCOPYDATASTRUCT, 'cbData', DllStructGetSize($tBuffer)) DllStructSetData($tCOPYDATASTRUCT, 'lpData', DllStructGetPtr($tBuffer)) _SendMessage($hSciTE, _ $_WM_COPYDATA, _ $hWnd, _ DllStructGetPtr($tCOPYDATASTRUCT)) $bReturn = Not @error EndIf Return $bReturn EndFunc ;==>__SciTE_Send_Command #cs Added for color export. #ce #pragma compile(LegalCopyright, © You) ; Added for color export. Func ForColorExports() Return "This is not meant to run. Added for color export." ; "cmd " ..typing that would expand to "RunWait('"' & @ComSpec & '" /c |', '', @SW_HIDE)" ; The .S13 ("Abbrev-Expand") will not be rendered in the code, thereby preventing the value from being exported. ; for more help go to https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/SciTE4AutoIt3-AbbreviationHowTo.html Local $oShell = ObjCreate("shell.application") ; Get the Windows Shell Object Local $oShellWindows = $oShell.Windows() ; Get the collection of open shell Windows Send("{SPACE}") EndFunc ;==>ForColorExports /*** SciTE colors ***/ .S0 { color: #80C0FF; } /* White space */ .S1 { font-style: italic; color: #60A060; } /* Comment line */ .S2 { font-style: italic; color: #60A060; } /* Comment block */ .S3 { color: #C0FFFF; } /* Number */ .S4 { color: #8080FF; } /* Function */ .S5 { color: #C080C0; } /* Keyword */ .S6 { color: #A0A000; } /* Macro */ .S7 { color: #F0E090; } /* String */ .S8 { color: #FF8000; } /* Operator */ .S9 { color: #D0D0D0; } /* Variable */ .S10 { color: #A0A0A0; } /* Send keys in string */ .S11 { color: #8996A8; } /* Pre-Processor */ .S12 { color: #FFAAB7; } /* Special */ .S14 { color: #993399; } /* COM Objects */ .S15 { color: #0080FF; } /* Standard UDF's */ /* span { font-family: 'Courier New'; color: #D0D0D0; font-size: 10pt; } */ /*** SciTE colors ***/ that is easier to see and edit, and with some help for what applies to what. ( you could test online too ) I'll have my test site updated soon(done) to reflect what's in the works. Given that the test site, is testing stuff, some times the prior CSS or JS may be used instead of the current. To clear the cache data, open "inspect data", go to network and tick "Disable cache". Reload the page and that should be all that's needed.1 point -
AutoIt v3.3.17.1 Beta View File 3.3.17.1 (July 08, 2025) (Beta) AutoIt: UDFs: - Fixed: Typo in variable name in Date.au3 introduced in previous beta. 3.3.17.0 (June 29, 2025) (Beta) AutoIt: - Changed: Windows 7/Server 2008 is now the minimum OS version required due to dev environment changes. - Added #3891: DllCall() performance optimisation. - Added: Standard Windows Fonts List for Win10/Win11. - Added #3906: GUICtrlCreateXXX creation in example assign to $idXXX to reflect Ctrl type. - Added: FileGetAttrib() retrieve Join folder (J) as created by FileCreateNTFSLink(). - Added: Split WindowsConstants.u3 in WindowsNotifsConstants.au3, WindowsStylesConstants.au3 and WindowsSysColor.au3. - Added: #3984: GUICtrlSetGraphic() doc precision. - Fixed: Doc Chr(0) handling inside functions. - Fixed #3923: Doc typo in "Send Key List". - Fixed: Regression #3135 handle leak (Thanks Nano, Rudi, Nine). - Fixed #3925: Doc With ... EndWith using DllStruct Type. - Fixed: Links in Tutorials example code (thanks argumentum). Au3info: - Added: Display mouse coordinate mode. - Fixed #3917: Crash under Win7. SciTE-Lite: - Fixed: Folding Fix for #Preprocessor foldblock when followed by a CommentBlock. UDFs: - Added: script examples when running under Win11 with new notepad.exe. - Added: _GUICtrlTreeView_GetItemByIndex() can retrieve handle of the list of main item ($hItem= -1). - Added: _IsPressed() can be called with numeric value as in "WinAPIsvkeysConstants.au3". - Added #3909: _DebugReportData() to report Array column formatted. - Added: libExamples referring MemoWrite() now refer to _MemoWrite() defined in Extras\HelpFileInternals.au3. - Added: _WinAPI_WaitSystemIdle(), _WinAPI_QueryDiskUsage(), _WinAPI_QueryProcessorUsage(), _WinAPI_QueryProcessCycleTime() - Added: Doc _WinAPI_GetWindowSubclass() example (Thanks pixelSearch). - Added: _WinAPI_GetKeyboardLayout() default value for the running thread. - Added: _WinAPI_GetUserDefaultLCID() example. - Added: _WinAPI_GetKeyboardLayoutLocale(). - Added: _WinAPI_GetKeyboardState() example (Thanks AutoXenon). - Added #3932: Try to use file in HelpFile\Extras instead of @ScriptDir. - Added #3934: _WinAPI_SetTimer() example. - Added: _IsPressed() can wait on one of several keys. - Added: _WinAPI_SendInput(). - Added #3960: _Div() integer division. - Added #3963: _WinAPI_OpenEvent(). - Added: _GDIPlus_ImageSaveToFile() doc precision for compression level. - Added: _WinAPI_GetCursorSize() and _WinAPI_SetCursorSize(). - Added: $FOLDERID_Documents Constants in APIShellExConstants.au3. - Added: Support _GUIToolTip*() to be used to external process. - Added: Support _GUICtrlHeader*() to be used to external process. - Added: Support _GUICtrlStatusBar*() to be used to external process. - Added #3988: _WinAPI_GetSystemPowerStatus() return Battery status saver. - Added #3985: _ArrayDisplay() + $WS_EX_TOPMOST. - Added #3991: _SQLite_ForeignKeys() and Add a parameter in _SQLite_Open() to set it also. - Added #3990: _IsPressed() return in @extended if the key is still pressed. - Added: _DebugSetup(..., 1) does not interact with script being debug, Report infos copied to clipboard - Added: _WinAPI_SetWindowTheme() example to demonstrate Checkbox or Radio controls coloring. - Added #3997: _WinAPI_RegisterShellHookWindow() example improvement. - Added #3999: _WinAPI_OemToChar() performance improvement. - Added #3946: _ChooseFont() updated defaults (thanks argumentum). - Added: _DateDiff(), _DateAdd() using array for [days, hours, minutes, seconds]. - Added: _DebugSetup() Type 6, same as 1 but a timeout to close the report log windows. - Fixed #3894: _WinAPI_GetProcessName() returns incorrect result when process ID is invalid. - Fixed: "Then SetError()" in several standard UDF. - Fixed #3921: Missing _GUICtrlStatusBar_SetParts() examples. - Fixed: Doc typo $GPIP_ERR* >> $GDIP_ERR*. - Fixed #3926: _GUICtrlTreeView_SetChildren() not set/reset chidren flag. - Fixed: _WinAPI_DisplayStruct() elements containing chr(124). - Fixed #3945: StringRegExp() /s include VT. - Fixed #3949: _ArrayDisplay() does show multiple subscript of an array. - Fixed #3954: links in libfunction constants. - Fixed: missing doc description $iSubItem = - 1 in _GUICtrlListView_SetItemText(). - Fixed #3959: _WinAPI_ShellUserAuthenticationDlg() example. - Fixed #3975: unrelated link in Pcre doc. - Fixed #3903: _GuiCtrlTab_GetItem() does work on external process. - Fixed #3992: _WinAPI_DwmSetWindowAttribute() does not support all MSDN attributes. - Fixed #4001: _GUICtrlListView_*() example ($tagNMITEMACTIVATE). - Fixed #4003: _ArrayPush() doc precision. - Fixed: _GUICtrlButton_SetSplitInfo() example crash. - Fixed: Support of Notepad under Win11 for _DebugSetup(). - Fixed #4022: Various doc duplicated words. - Fixed #4031: _DebugArrayDisplay() buttons display. - Fixed: _DebugArrayDisplay() not executed if @error on entering ($ARRAYDISPLAY_CHECKERROR if no display wanted on @error). - Fixed #4033: _DateTimeSplit() setting $aTimePart[0] whem no time defined. - Fixed #4024: _DebugSetup(,, 5) (notepad window) not working under Windows 11. - Fixed: _WinAPI_IsElevated() @extended return value (Thanks Argumentum). - Fixed #4039: _GUICtrlTreeView_Delete() with $hWnd. - Fixed #4038: _GUICtrlRichEdit_StreamToFile() extra new paragraph. - Fixed #4029: _Date_Time_SystemTimeToDateTimeStr() Wrong output. - Fixed #4040: _GUICtrlRichEdit_SetZoom() parameter limitation bug. - Fixed #4041: _GUICtrlStatusBar_SetIcon() not shown. Submitter Jon Submitted 07/08/2025 Category Beta1 point