1 post in this topic
I want to programmatically alter the structure of a large number of PDF which have different sizes and orientation, and come from different generators. To do this I need to be able to capture different parameters describing their layout. I use a console tool called pdfInfo (part of the xpdf public domain suite) which provides me with everything I need. The idea is first to run pdfInfo against my pdf file redirecting the console's output to a text file. And then to load and parse the text file to get the parameters I need. The only problem is that no output file is ever created. I've looked through the forums and saw a number of threads loosely related to this but none of the suggested solutions (like using StdoutRead) has worked for me. I should say maybe that I'm running Win10.
So here's the code that doesn't work:
$pdfInfo = "f:\pdfinfo.exe" $pdfTest = "f:\test.pdf" RunWait(chr(34) & $pdfInfo & " -box " & $pdfTest & " > f:\log.txt", "", @SW_HIDE) If you use in a console the command line:
f:\pdfinfo.exe -box f:\test.pdf > f:\log.txt
it works perfectly. But the piece of code above does not create the log.txt file. So any idea what I am doing wrong. Thanks for any help!
In my work place they blocked the application movemouse. so y decided to do one by myself , to cheat the system.
I have used some peaces of code from another scripts I have, and also I have found in this forum
Hope this helps
$version="0.2" #include <Misc.au3> If _Singleton(@ScriptName, 1) = 0 Then ; allow only one instance MsgBox(0, "Warning", "An occurence of " & @ScriptName & " is already running") Exit EndIf #region tray icon #NoTrayIcon Opt("TrayIconHide", 0) Opt("TrayMenuMode", 1) TraySetToolTip("Ratoner "& $version) Local $exititem = TrayCreateItem("Exit") TraySetState(1) ; Show the tray menu. #endregion #region variables $BlockScreensaver=1 $flagMouse=1 $MouseNotMovedCounter=0 $posMouseMovedX=0 $posMouseMovedY=0 $Counter= 0 #endregion #region main Local $hTimer = TimerInit() while 1 $Counter=$Counter+1 if $Counter>1000 then CheckifMouseMove() if $MouseNotMovedCounter>2 then moveMouse() $Counter= 0 endif Switch TrayGetMsg() Case $exititem exit EndSwitch sleep(50) wend #endregion #region functions func CheckifMouseMove() ;~ ConsoleWrite("+CheckifMouseMove()" & @crlf) $posMouseMoved = MouseGetPos() if $posMouseMovedX<>$posMouseMovedor $posMouseMovedY <> $posMouseMoved then $posMouseMovedX=$posMouseMoved $posMouseMovedY=$posMouseMoved $MouseNotMovedCounter=0 ;~ ConsoleWrite('>$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf ) Else ;$MouseMoved=0 $MouseNotMovedCounter=$MouseNotMovedCounter+1 ;~ ConsoleWrite('--$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf ) endif EndFunc func moveMouse() ;~ ConsoleWrite("+moveMouse" & @crlf) Local $posMouse = MouseGetPos() $flagMouse=$flagMouse*-1 Local $new_y = $posMouse + $flagMouse ; + (10*$flagMouse) MouseMove($posMouse,$new_y) $MouseNotMovedCounter=0 ;~ ConsoleWrite("+mouseMove $MouseNotMovedCounter" & $MouseNotMovedCounter & @crlf) endfunc #endregion
I am running my compiled application as a console application and need to prevent any internal errors from being displayed as a gui message, but rather display it as a console message only. An example of such an error would be a bad array reference (out of bounds).
Does anyone know how to do this or point me in the right direction?
I normally launch things silently, but now I want to launch a batch (.cmd) file and have it run as normal displaying it's standard output to the user. Whether I use ShellExecuteWait or RunWait, the command prompt window is displayed, but the output is blank (although I know that the batch file is processing normally because it also produces a log file).
If this is because AutoIt is re-directing the standard I/O of the batch file/console window, is there a way I can bypass the I/O redirection?
I'm really new to AutoIT, and I have little experience with scripting or any sort of programming. But I'm trying to learn!
Right now, what I'm trying to do is make a quick script that repeats a few functions while a key is held down. I want to see if I can make a quick-burst script that might work in Fallout 4 with machine guns
#include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep(100) If _IsPressed("01", $dll) Then MouseDown("left") Sleep(320) MouseUp("left") Sleep(25) EndIf WEnd DllClose($dll) Right now, when I hold down my left mouse button, it just repeats the script once - then I have to release and hold again to enable it again. Is it possible to to start it from the top and basically just repeats itself while I'm holding down my mouse button?
In advance, thank you!