Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/22/2023 in all areas

  1. Greetings all, While I am working with various projects along the way I often hit a reoccurring frustration of needing to know if I spelled a comment or string correctly, and have often needed to copy my word into a document to spellcheck it and then correct as needed, which feels much like a waste of time. I have finally decided to solve my problem by utilizing Libre Office. After running across a post by GMK, demonstrating his Spell Checker script, I thought I would make my own version. And now that I have this working satisfactorily, I thought I would share it in case others are sitting in a similar spot as I was. Note: this add-on is not recommended for those new to modifying their Scite User Properties, or are unaware of where their App Data Scite installation is. This utilizes the Libre Office spell checking engine for use in Scite4Autoit so you can check the spelling of words on the fly using a shortcut combo, and offering suggestions if the word is misspelled. This Add-on also allows you to spellcheck an entire script or a selected range's Strings, Comments, and comment blocks for misspelled words, marking them for review. The Script Spell checker skips words with the following in them: . $ # @ _ : / \ I have added the ability to spell check in other, and/or multiple, languages, though I am limited to my ability to test this, English being my only language. Requirements: Full installation of Scite4AutoIt LibreOffice (Installed version only, portable will not work.) Desired Spell Checking language installed in Libre Office. Installation To "Install" this Add-On for Scite4AutoIt, do the following. Navigate to %LocalAppData%\Local\AutoIt v3\SciTE (You can copy and paste this into Start search box and push enter) Copy the "Scite4AutoIt_LO_SpellChecker" folder into this directory. Do one of the following, depending on if you already have custom lua scripts present in PersonalTools.lua or not. If you do not have custom scripts present in PersonalTools.lua, find in this same directory the file PersonalTools.lua, and rename it to PersonalTools.lua.old Copy the PersonalTools.lua file from the Add-On folder to the %LocalAppData%\Local\AutoIt v3\SciTE directory. If you do have custom scripts present in PersonalTools.lua, Open the PersonalTools.lua file in the Add-On folder and copy everything in the file below the following entry, ------------------------------------------------------------------------------- -- required line ... do not remove PersonalTools = EventClass:new(Common) ------------------------------------------------------------------------------- Paste the contents into the end of the PersonalTools.lua file found in the %LocalAppData%\Local\AutoIt v3\SciTE directory. Open your SciTEUser.properties file, (go to Scite editor and Select "Options" in the toolbar, Select "Open User Options File".) Copy and paste the following into the SciTEUser.properties File. (If you have previous custom Lua Scripts, you may need to modify the command numbering.) #~ Single Word Spell-Check lua Script command.name.45.$(au3)=Sp-Check Current Word command.mode.45.$(au3)=subsystem:lua,savebefore:no command.shortcut.45.$(au3)=Ctrl+Shift+F command.45.$(au3)=InvokeTool PersonalTools.SingleWordCheck #~ #~ Entire Script Spell-Check lua Script command.name.46.$(au3)=Sp-Check Entire Script command.mode.46.$(au3)=subsystem:lua,savebefore:no command.shortcut.46.$(au3)=Ctrl+Shift+G command.46.$(au3)=InvokeTool PersonalTools.CheckScript #~ #~ Clear Spell Checking Marking lua Script command.name.47.$(au3)=Sp-Check Clear command.mode.47.$(au3)=subsystem:lua,savebefore:no command.shortcut.47.$(au3)=Ctrl+Shift+H command.47.$(au3)=InvokeTool PersonalTools.ClearSpChk #~ *You may modify any Shortcut key combinations as necessary.* Restart Scite Ignored Words You can add words to ignore in the file "Scite4AutoIt_LO_IgnoredWords.ini" that you placed in "%LocalAppData%\Local\AutoIt v3\SciTE\Scite4AutoIt_LO_SpellChecker". ONLY one word per line. No lone punctuation characters please. Words are Case Sensitive. Properties - You may set the following properties by pasting the property values in your "User Options" File (from Scite's toolbar go to, Options->Open User Options File), and modifying the value after "=" ###Language and Country### S4A.SpellCheck.Language=en S4A.SpellCheck.Country=US Language code must be a LOWER CASE two or three character ISO 639 Language Code. You can find a list of these codes online, such as https://iso639-3.sil.org/code_tables/639/data Country code must be an UPPER CASE two character ISO 3166 Country Code. You can find a list of these codes online, such as https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 YOU MUST HAVE the desired Language installed in Libre Office already for this to work. Default is Language: en, Country: US Also accepts multiple value pairs separated by a semicolon, such as: S4A.SpellCheck.Language=en;pl S4A.SpellCheck.Country=US;PL Pairs must be equal between Language and Country. And each column must be a valid Language and Country pair. i.e. (en US), (pl PL). The first language/country pair listed is considered your primary language and any words will be checked by it first. Duplicate suggestions are automatically removed, when multiple languages are used. ###Misspelled Word Highlighting### S4A.SpellCheck.Highlight=0xFF00FF Modify the misspelled word highlighting. Must be 8 characters long, and contain only a-f, x, and 0-9 and begin with 0x. Highlighting color code is Hex color code of B(lue) G(reen) R(ed) (Not RGB). One way you can obtain this value is by using the value given from the example script provided with AutoIt function _ChooseColor, and selecting the BGR button. Default is 0xFF00FF ###Maximum Suggestions### S4A.SpellCheck.MaxSuggestions=10 Set the maximum words returned per language/country pairs. Must contain only digits, and be greater than 0. Default is 10. ###Markers Off### S4A.SpellCheck.UseMarkers=y - Set to "n" (no quotes) to skip adding a marker in the left hand margin of Scite on each line containing a spelling error. Notes This function uses the following Styles for Scite functions. UserList Type: 18 Indicator Style: 10 Marker Number: 18 This has been developed using the Scite4AutoIt Beta Version 5, currently being developed by Jos, I tried it in the standard Scite4A release V. 4 and it seems to function properly, except, in the standard Scite release a cmd window appears for a second or two. I seem to be unable to get around this. However it does not appear in the beta release. I would be happy to hear any suggestions, though I can’t promise prompt help or replies, but will do what I can. I am currently still working on another project, so anything done to this will be sporadic and delayed. v0.1.1 Scite4AutoIt_LibreOffice_SpellChecker.zip
    1 point
  2. My problematic sense are tingling, but that aside, this function may help get you started. _WinAPI_IsInternetConnected()
    1 point
  3. Well @MattHiggs, there it is ready for download.
    1 point
  4. This can be done easy without many changes. Just download and include _uiaccess.au3 from here and add this line after GUI is created. #include <WinAPI.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> #include "_uiaccess.au3" ; <<< ------ Include this ... ... ... Global $hGui = GUICreate("TheCircleOfMouse", $iCircleSize, $iCircleSize, 0, 0, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TRANSPARENT + $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW, WinGetHandle("[CLASS:Shell_TrayWnd;]")) GUISetBkColor($ColorDefault) ; * <-- set the color GUISetState() WinSetOnTop($hGui, '', 1) ; <<< ------ Add this line PS: @argumentum I blame you for poor coding. What's this bunch of functions in the first part of the script? Finally on line 110 I found the main GUI.
    1 point
×
×
  • Create New...