Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/20/2023 in all areas

  1. TheSaint

    Kobo Cover Fixer

    Tonight I decided to do a bit more code for this project for safety reasons ... a purely precautionary measure, and probably not needed. Basically I wanted to remove all the Placebo image files from my Kobo device, but because I have downloaded more ebooks to it, and done a partial sync, I wanted to make sure the removal process did not remove more than it should. So to that end I added a basic count check, remembering that each empty image folder got given 120 placebo image files. My original code just deleted all files in each previously empty folder that had the file extension '.parsed'. My new code builds on that with a count check of the first empty folder, reports that with a query about continuing with removals. If continue is selected by the user, then every other folder being processed does a count check comparison. A simple but probably suitable check, just in case other '.parsed' files have been added to one or more of the previously empty folders on my Kobo device. If the count doesn't match for a folder, then the user is shown the comparison result and prompted about continuing or not. This safety measure does not cater for any removals or replacements of placebo image files that the Kobo software may have done, but I consider that a highly unlikely occurrence. At worst, if that last thing ever did happen, then a cover replacement would be required. So really my safety measure is more a convenience measure, hopefully preventing any need for fixes. As part of my code, I also belatedly realized that the REMOVE button process, like the other two placebo button processes, that had the disable/enable controls code added later, was also missing that, so I added that in ... as well as replacing the Splash message with status messages. DOWNLOAD Kobo Cover Fixer.au3 (45 previous downloads) SEE THE FIRST POST in this topic for this latest version. 170.89 kB P.S. It has also occurred to me, that my flaky USB issue with my Kobo device might be a driver issue on this PC. At some point I will check that with my new laptop. I seem to recall I did have to find and install a driver a couple of years ago for the Kobo device to get recognized. This PC well and truly predates Kobo devices. P.S.S. Or maybe that driver was for my new phone.
    1 point
  2. you are looking for array? Local $mVar=100, $var=[$mVar+1,$mVar+2,$mVar+3,$mVar+4,$mVar+5] ConsoleWrite("$mVar = " & $mVar & @CRLF) ConsoleWrite("$var[0] = " & $var[0] & @CRLF) ConsoleWrite("$var[1] = " & $var[1] & @CRLF) ConsoleWrite("$var[2] = " & $var[2] & @CRLF) ConsoleWrite("$var[3] = " & $var[3] & @CRLF) ConsoleWrite("$var[4] = " & $var[4] & @CRLF) #cs ;~ or #include <Array.au3> Local $mVar=100, $var[0] For $x = 1 To 40 _ArrayAdd($var, $mVar + $x) Next _ArrayDisplay($var) #ce
    1 point
  3. Most likely related to x64, try #AutoIt3Wrapper_UseX64=y. Edit: RequireAdmin and Token stuff only required for system processes, normal non-Admin process and be accessed without it (as msedge.exe). #RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Array.au3> #include <WinAPIHObj.au3> #include <WinAPIProc.au3> Local $aAdjust, $aList = 0 ; Enable "SeDebugPrivilege" privilege for obtain full access rights to another processes Local $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust) ; Retrieve command-line arguments for all processes the system Local $iEnum = 0 If Not (@error Or @extended) Then $aList = ProcessList() Local $aList_CMD[$aList[0][0] + 1][3] $aList_CMD[0][0] = $aList[0][0] For $i = 1 To $aList[0][0] $aList_CMD[$i][0] = $aList[$i][0] $aList_CMD[$i][1] = $aList[$i][1] $aList_CMD[$i][2] = _WinAPI_GetProcessCommandLine($aList[$i][1]) If $aList_CMD[$i][2] Then $iEnum += 1 Next EndIf ; Enable SeDebugPrivilege privilege by default _WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust) _WinAPI_CloseHandle($hToken) _ArrayDisplay($aList_CMD, '_WinAPI_GetProcessCommandLine - ' & $iEnum) vs. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Array.au3> #include <WinAPIProc.au3> Local $iEnum = 0 Local $aList = ProcessList("msedge.exe") Local $aList_CMD[$aList[0][0] + 1][3] $aList_CMD[0][0] = $aList[0][0] For $i = 1 To $aList[0][0] $aList_CMD[$i][0] = $aList[$i][0] $aList_CMD[$i][1] = $aList[$i][1] $aList_CMD[$i][2] = _WinAPI_GetProcessCommandLine($aList[$i][1]) If $aList_CMD[$i][2] Then $iEnum += 1 Next _ArrayDisplay($aList_CMD, '_WinAPI_GetProcessCommandLine - ' & $iEnum)
    1 point
  4. Maybe something like this ? : Local $var3 = 100, $var1 = $var3, $var2 = $var3 ConsoleWrite("Var1 = " & $var1 & @CRLF) ConsoleWrite("Var2 = " & $var2 & @CRLF) ConsoleWrite("Var3 = " & $var3 & @CRLF)
    1 point
  5. TraySetToolTip("An example of a tray menu tooltip.")
    1 point
  6. NOTE: Run, Compile and Build Script functions require the full install of SciTE4AutoIt3 alongside AutoIt. https://marketplace.visualstudio.com/items?itemName=Damien.autoit
    1 point
  7. Bring up the extension in VSCode and take a look at the Feature Contributions tab. Under the Commands section, you will see entries for Build (F7) and Compile (Ctrl+F7). You can also invoke these commands via the Command Palette (Ctrl+Shift+P).
    1 point
  8. Right. This is the case if <CR> is added and the newline processed anyway In my previous code I used "Return 1" (meaning add <CR> without processing the newline) . In this case "\par" is not present in the stream so to change the <CR> seen in the Richedit to a real newline visible in the rtf file it is necessary to add "\line" in the stream - BTW "\par" could be used instead of "\line" in the replacement
    1 point
  9. Taking the idea from @Melba23's (btw, thanks ) ExtMsgBox and also making use of his StringSize UDF, I made a extended version of the InputBox function. From the README file: This UDF creates input boxes (just like native InputBox), but with multiple inputs. You can also set some inputs to be password-style, set the default texts for some of the edits and even set the label of the OK/cancel buttons. How to use _ExtInputBox($sTitle, $sTexts [ , $sDefaults = Null [ , $sPasswords = Null [ , $sBtnLabels = "OK|Cancel" [ , $iWidth = -1 [ , $iLeft = -1 [ , $iTop = -1 [ , $iTimeout = 0 [ , $hParent = 0 ] ] ] ] ] ] ] ] ) Arguments are: $sTitle (mandatory): The window title (e.g.: "Hello World") $sTexts (mandatory): The edit labels, separated by | (e.g.: "Your email|Your password") $sDefaults: The default input texts, separated by | (e.g.: "|you@us.com||" will tell that the first input will have nothing as default text, the second will have you@us.com as default text and the third and forth will also have nothing). Note that if you set the default value of 1 input, you must set the value of them all (even if it's nothing), otherwise all inputs will have no default value. Default is none. $sPasswords: One or more 1-based index of inputs, separated by anything that is not a number (pipeline - | - recommended), of the inputs that will receive password style (e.g.: "2|3" wíll tell that the second and third inputs are password-style, default is none) $sBtnLabels: The TWO label of the default OK/Cancel buttons (e.g.: "Submit|Close") $iWidth: Window width (default is the size of the longest string with the limit of 25% of the screen width). Obviously it's not possible to set the height as it's calculated automatically. $iLeft: Distance of the window from the left side of the screen (default is centered) $iTop: Distance of the window to the top of the screen (default is centered) $iTimeout: Time limit for filling the form data (default is none) $hParent: Parent form (default is none) Return value Sucess: an 1-based array with the input values entered ($aArray[1] = 1st input value, $aArray[2] = 2nd input value, $aArray[n] = nth input value, whereas $aArray[0] = input count) Failure: False, and set @extended to 1 if the user clicked cancel, 2 if the user closed the window, or 3 if timeout ended. Examples (two of them) #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Username|Password", Null, "2") If $sData = False Then MsgBox(0, "", "You pressed cancel, exit or timeout ended.") Else MsgBox(0, "You entered:", "Username: " & $sData[1] & @CRLF & "Password: " & $sData[2]) EndIf #include 'ExtInputBox.au3' $sData = _ExtInputBox("Login", "Your full name|Your email|Your telephone|Choose an username|Choose a password|Repeat password", "Mr./Ms. ||+1 |admin||", "5,6", "Register|Cancel") If $sData = False Then Switch @extended Case 1 MsgBox(0, "", "You clicked Cancel") Case 2 MsgBox(0, "", "You closed the window.") Case 3 MsgBox(0, "", "Timeout ended (but we have no timeout on this example, so this will never happen)") EndSwitch Else MsgBox(0, "You entered:", "Full name: " & $sData[1] & @CRLF & _ "Email: " & $sData[2] & @CRLF & _ "Telephone:" & $sData[3] & @CRLF & _ "Username: " & $sData[4] & @CRLF & _ "Password: " & $sData[5] & @CRLF & _ "Password repeat: " & $sData[6]) EndIf Download Download ZIP from GitHub Btw, fork me on Github
    1 point
  10. Not on my old PC, not anymore. The more programs you have installed the slower it gets. After many years I have many programs installed. And it is always worst at startup, when I want to get going. It isn't anywhere near as bad later .. unless memory issues impact. Anyway, its not just about slowness, but also about fiddly. Much easier just to double-click that desktop shortcut and drag & drop my text based file onto the resulting floating dropbox ... especially if more than one file.
    0 points
×
×
  • Create New...