Hello everyone,
I hope, my english is good enough to explain my problem...
i´m very new to autoit, but already trying to solve a problem.
To tell it in advance: no commercial interest is connected to my request. I´m trying to solve this problem for private reasons.
I need a free tool, that monitors a directory C:\print) for new PDF-files.
If a new file appears, the tool shall print it to the default printer and move it to another folder (c:\gedruckt).
Due to the circumstance that i´m trying to print to a datacard sd260 Card-Printer, which needs a native windows driver, i have no choice but
use acrobat reader 11 under windows XP.
Printings from Ghostscript/ghostgum are black/white and wrong scaled...
Unfortunately, acrord32 won´t close after printing which stops the function i already have.
I searched via google and tried to merge some code snippets. But it oesn´t work.
The code i already have leads to an endless loop of acrord32 instances opening and trying to print without moving the files.
#NoTrayIcon
; Hier kannst du einen Hotkey zum Beenden des Programms festlegen
; in Anführungszeichen vorm Komma, z. Z. ALT+SHIFT+Q
HotKeySet("+!q", "Quit")
;Anpassungen
;Pfad zur Acrord32.exe
$acrobat = "C:\Programme\Adobe\Reader 11.0\Reader"
; Pfad der auf neue Dateien überwacht werden soll
$source = "c:\print\"
; Pfad, in den die Dateien nach dem Drucken verschoben werden sollen
$dest = "c:\gedruckt\"
; Dauer des Prüfintervalls in Millisekungen (10 Sek = 10000)
$interval = 10000
While 1
Sleep($interval)
$file = FileFindFirstFile ($source & "\*.pdf")
If $file <> -1 then Print()
FileClose($file)
Wend
Func Quit()
Exit
EndFunc
Func Print()
While 1
$pdffile = FileFindNextFile($file)
If @error then ExitLoop
Local $iPID = RunWait('"' & $acrobat & '\AcroRd32.exe" /t "' & $source & '\' & $pdffile & '" ')
WinWait ("[CLASS:Acrord32]", "", 1)
;Sleep(2000)
FileMove('"' & $source & '\' & $pdffile & '"', '"' & $dest & "'", 1)
ProcessClose ($iPID)
WEnd
EndFunc
Can anyboy help me with my problem and tell me what to do to get it working?
Thank everyone in advance for reading to here.
Best regards
McNugget