Jump to content

McNugget

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by McNugget

  1. Thank you, Bilgus. The script is intended to work without user inputs. Best regards McNugget
  2. One last question: Are there any suggestions to improve "my" code snippet? Best regards McNugget
  3. IT WORKS! Thank you all so much... Best regards McNugget
  4. Oh... That was already fixed by me. Thank you for the question. Thank you for the hint with runwait(). It runs better now. I think, i only run x86 applications. How can i check i use the right version of autoit3? This is the actual code snippet i use. My last problem to be solved is: Why doesn´t it move the file? It still remains in the source folder... #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 RunWait ('C:\Programme\bioPDF\Acrobat Wrapper\acrowrap.exe /acceptlicense /t "' & $source & '\' & $pdffile & '" ') ;Sleep(5000) FileMove('"' & $source & '\' & $pdffile & '"', '"' & $dest & "'", 1) WEnd EndFunc Do you have any ideas/suggestions to fix/optimize the script? Thank you all for your kind assistance. I´m glad to get your help. Best regards McNugget
  5. Hello again... Update: I don´t get it to work. This is the actual code snippet i am using: #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 Run('C:\Programme\SumatraPDF\SumatraPDF.exe -silent -print-to "PDFCreator" ' & $file, "") ;Local $iPID = RunWait('"' & $acrobat & '\AcroRd32.exe" /t "' & $source & '\' & $pdffile & '" ') ;WinWait ("[CLASS:Acrord32]", "", 1) ;Sleep(2000) FileMove('"' & $source & '\' & $pdffile & '"', '"' & $dest & "'", 1) ;ProcessClose ($iPID) WEnd EndFunc The result is, that nothing happens. Sumatra is installed... Why doen´t it work? Best regards McNugget
  6. Thanks to you all for your input. I´ll try if i´m able to get it running. One question: How should i move the file before i print it??? In this case there wouldn´t be a file to print before i started the print process... Or do i have a problem in understanding? Best regards McNugget
  7. 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
×
×
  • Create New...