Jump to content
Sign in to follow this  
JesseBarnett

Irfanview Thumbnails, batch rotate/print

Recommended Posts

JesseBarnett

My first AutoIt script needs help. Sorry if answered before but not even sure what in the heck the search query would be. Even thou I only have one thumbnail selected for either the -rotate() function or batch print, I end up with the one I selected plus the first thumbnail being processed:

Func _rotate()
MsgBox(262144,"","Pick the dwgs you need to rotate and then click OK")
;WinActivate("IrfanView Thumbnails")
;WinWaitActive("IrfanView Thumbnails")
    Send("b")
    WinWait("Batch conversion")
    SplashTextOn("","Make sure Output Format is same as orginal" & @CRLF & "Then click Advanced",400,50,-1,-1,0,16)
    WinWait("Settings for all images:")
    SplashOff ()
    SplashTextOn ("Batch Print", "Pick either Rotate left or Rotate right" & @CRLF & "Make sure Overwrite Existing is checked" & @CRLF & "Then click OK",400,75,-1,-1,0,16)
    WinWaitClose("Settings for all images:")
    SplashOff ()
    Sleep(200)
    Send("{Tab}")
    MouseClick ( "left", 100, 400) 
    MouseClick ( "left", 80, 525)   
;ControlSend("Batch conversion","","Button5","{ENTER}")
    WinWaitClose("Batch conversion")
    WinWait("Batch conversion")
    WinWaitNotActive("Batch conversion done","Copy to Clipboard")
    MouseClick ( "left", 690, 530)
EndFunc
    
Dim $sTitle = "Irfanview Batch Printer"

    SplashTextOn ("Batch Print", "Open a dwg in the folder to print",400,25,-1,-1,0,16)
    $nPID = Run ("C:\Program Files\IrfanView\i_view32.exe", "", @SW_MAXIMIZE)
    WinWait ("IrfanView")
    Send("o")
    Sleep(200)
    WinWaitClose("Open")
    SplashOff ()
    Sleep (1000)
    Send("t")
    WinWait ("IrfanView Thumbnails")
    MsgBox (262144,"","Click OK after all dwgs loaded")
    $response = MsgBox(262148,"Rotation","Do you need to rotate dwgs?")
    Sleep(100)
    If $response = 6 then
        _rotate()
    Else
        Send("!{Tab}")
        Sleep(500)
    EndIf
    Sleep (500) 
    Send("{Tab}")
    sleep(200)
    Send("{F5}")
    MsgBox(262144,"","Select Files you want to print and click OK")
;WinActivate("IrfanView Thumbnails")
;WinWaitActive("IrfanView Thumbnails")
    Send("!fp")
    WinWait("Print Preview")
    Send("!pp")
    Sleep (500)
    ControlSend("Print Preview","", "Button14","{ENTER}")
    sleep(2000)
    Opt("WinTextMatchMode", 2)
    WinWait("pdfFactory", "View PDF")
    ProcessClose ($nPID)

Share this post


Link to post
Share on other sites
martin

My first AutoIt script needs help. Sorry if answered before but not even sure what in the heck the search query would be. Even thou I only have one thumbnail selected for either the -rotate() function or batch print, I end up with the one I selected plus the first thumbnail being processed:

Func _rotate()
MsgBox(262144,"","Pick the dwgs you need to rotate and then click OK")
;WinActivate("IrfanView Thumbnails")
;WinWaitActive("IrfanView Thumbnails")
    Send("b")
    WinWait("Batch conversion")
    SplashTextOn("","Make sure Output Format is same as orginal" & @CRLF & "Then click Advanced",400,50,-1,-1,0,16)
    WinWait("Settings for all images:")
    SplashOff ()
    SplashTextOn ("Batch Print", "Pick either Rotate left or Rotate right" & @CRLF & "Make sure Overwrite Existing is checked" & @CRLF & "Then click OK",400,75,-1,-1,0,16)
    WinWaitClose("Settings for all images:")
    SplashOff ()
    Sleep(200)
    Send("{Tab}")
    MouseClick ( "left", 100, 400) 
    MouseClick ( "left", 80, 525)   
;ControlSend("Batch conversion","","Button5","{ENTER}")
    WinWaitClose("Batch conversion")
    WinWait("Batch conversion")
    WinWaitNotActive("Batch conversion done","Copy to Clipboard")
    MouseClick ( "left", 690, 530)
EndFunc
    
Dim $sTitle = "Irfanview Batch Printer"

    SplashTextOn ("Batch Print", "Open a dwg in the folder to print",400,25,-1,-1,0,16)
    $nPID = Run ("C:\Program Files\IrfanView\i_view32.exe", "", @SW_MAXIMIZE)
    WinWait ("IrfanView")
    Send("o")
    Sleep(200)
    WinWaitClose("Open")
    SplashOff ()
    Sleep (1000)
    Send("t")
    WinWait ("IrfanView Thumbnails")
    MsgBox (262144,"","Click OK after all dwgs loaded")
    $response = MsgBox(262148,"Rotation","Do you need to rotate dwgs?")
    Sleep(100)
    If $response = 6 then
        _rotate()
    Else
        Send("!{Tab}")
        Sleep(500)
    EndIf
    Sleep (500) 
    Send("{Tab}")
    sleep(200)
    Send("{F5}")
    MsgBox(262144,"","Select Files you want to print and click OK")
;WinActivate("IrfanView Thumbnails")
;WinWaitActive("IrfanView Thumbnails")
    Send("!fp")
    WinWait("Print Preview")
    Send("!pp")
    Sleep (500)
    ControlSend("Print Preview","", "Button14","{ENTER}")
    sleep(2000)
    Opt("WinTextMatchMode", 2)
    WinWait("pdfFactory", "View PDF")
    ProcessClose ($nPID)
I haven't studied the script but I think one of the advantages of Irfanview is that you can operate it from the command line with parameters. I would expect that was a much easier way to do what you want.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
JesseBarnett

I haven't studied the script but I think one of the advantages of Irfanview is that you can operate it from the command line with parameters. I would expect that was a much easier way to do what you want.

Not in this case. We recieve anywhere from 1 to 80 dwgs at a time at work in 1 of 3 different formats. Acad dwgs are no problem using Acad Publish, but we also recieve them in either tif or pdf format. Different interns have the job of dating the prints and sending them to the plotter and really need to be able to see them in the thumbnail view to see if some need rotated. Much faster doing it that way then having to open each, one at a time, rotating and saving.

Next problem is that some of the prints will need 4 copies and others will need 6. Again much easier picking the ones you want in thumbnail view. Once selected, the tifs or pdfs are printed to to pdfFactory with a variable footer, the resulting multipage pdf is opened and prints are dated in their title blocks using FoxIt Pro.

Our interns change on a regular basis and it is a pain to constantly retrain. With this script with it's pop up messages and auto button pushes, my 12 yr old daughter was able to do it herself last night.

Share this post


Link to post
Share on other sites
martin

Not in this case. We recieve anywhere from 1 to 80 dwgs at a time at work in 1 of 3 different formats. Acad dwgs are no problem using Acad Publish, but we also recieve them in either tif or pdf format. Different interns have the job of dating the prints and sending them to the plotter and really need to be able to see them in the thumbnail view to see if some need rotated. Much faster doing it that way then having to open each, one at a time, rotating and saving.

Next problem is that some of the prints will need 4 copies and others will need 6. Again much easier picking the ones you want in thumbnail view. Once selected, the tifs or pdfs are printed to to pdfFactory with a variable footer, the resulting multipage pdf is opened and prints are dated in their title blocks using FoxIt Pro.

Our interns change on a regular basis and it is a pain to constantly retrain. With this script with it's pop up messages and auto button pushes, my 12 yr old daughter was able to do it herself last night.

Fair enough. (I used to use my children to test how easy to use a program was too.)

No time to look at your problem now though.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×