Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/26/2019 in all areas

  1. Add Book & All Formats To Calibre updated to v3.6, see Post #4. (v3.6) Improved importation of KFX files that have already been processed before. NOTE - The program now checks for the existence of a plugin element of the KFX Input plugin. If found and enabled, it is disabled then re-enabled after all ebooks and their formats have been added. This is to prevent any already processed KFX file being seen as a new ebook, that needs to be collected into a KFX-Zip file before adding, and then turned into the KFX file it already is. Saves some time and unnecessary re-processing. This is possible, because my program requires and checks for the companion OPF file to add each ebook & formats.
    2 points
  2. Ah, this Win API escaped my search...
    1 point
  3. Have a look at _WinAPI_GetParentProcess and _ProcessGetName. The script will need to be compiled for it to work correctly. #include <Process.au3> #include <WinAPIProc.au3> Global $iScriptParentPID = _WinAPI_GetParentProcess(@AutoItPID) Global $sParentProcessName = _ProcessGetName($iScriptParentPID) MsgBox(0, "Process Name", $sParentProcessName) ;For testing. Adam
    1 point
  4. Jfish

    how detect file type ?

    Not a complete solution but got the approach from this site: https://blog.systoolsgroup.com/detect-file-type-without-extension/ The file information does appear in the hex string in the two I tested (PDF and RTF). That being said, probably better to use a third party software that does the heavy lifting for you, File Signature Identifying Files that don’t have an Extension If a file does not have an extension, it still has a file signature. You can identify the format of that file from its file signature. All file types have a standard and unique signature and this data is stored in the file itself. There are programs that can read this signature and determine the file format even if the extension is missing from the file name. All you have to do is get a freeware hex editor that can represent the hexadecimal structure of the file. The first set of bytes in a file represents a signature, which, in most cases, is 2-4 bytes long. If you are capable enough to identify it on your own well and good, otherwise, there is always Google one click away. #include <String.au3> $aFile=FileOpen(@DesktopDir&"\test",0) if @error then MsgBox(0,'ERROR',@error) local $firstLine=filereadline($aFile) $hexData=_HexToString ( $firstLine ) ConsoleWrite(@crlf&$hexData)
    1 point
  5. To find the parent process PID you can use this:
    1 point
  6. I think he wants to know which process launched the autoit script... ps. another option is to pass the launcher PID as a command line parameter to the autoit script.
    1 point
  7. Nine

    Timer function

    Here something like that : Func _Pause() $Paused = Not $Paused If $Paused then $TimerTotal += TimerDiff ($TimeTicks) ; Keep total of timer GUICtrlSetData($Elapsed, "Paused") Else $TimeTicks = TimerInit () EndIf While $Paused Sleep(100) WEnd EndFunc ;==>_Pause You must declare those variables as Global at the beginning of the script. Global $TimeTicks, $TimerTotal = 0 Now last changes, you must add $TimerTotal to elapsed times, and you must reset $TimerTotal = 0 when you do a new TimerInit ()
    1 point
  8. @BetaLeaf I also recommend using $STDERR_MERGED with Run to capture the standard error stream as well, otherwise you would not get anything which might be written to STDERR
    1 point
  9. You should read this in a While 1 loop, and check for error (no more lines to read). Something like: While 1 $sOutput &= STDOutRead($iPID) If @error Then ExitLoop WEnd All the other errors appear because there is no data in the variable $sOutput. Apply these changes, and try to display the content of the $sOutput variable
    1 point
  10. What have you tried so far, and how can we help with your script?
    1 point
  11. @Danyfirex Keep it up. Appreciate your effort and share
    1 point
  12. czardas

    Timer function

    Learn about function parameters and the syntax used to create them. #include <MsgBoxConstants.au3> Local $iVariable = Addition(7, 2) MsgBox($MB_OK, "Add Parameters", $iVariable) Func Addition($iParam_A, $iParam_B) ; example function with two parameters Return $iParam_A + $iParam_B ; add the parameters together and return the result EndFunc ;==> Addition Then rewrite the function _Counter() and add the parameters you need to do what you want.
    1 point
  13. Updated. 😊
    1 point
  14. 1 point
×
×
  • Create New...