Home Image-Pro Automation (Macros, Apps, Reports)
Options

How do acquire images to disk and specify he path and name within the macro?

I tied recording this within the capture interface but the only thing that was recorded was the capture.


I want to create an app where a user can select a path as a save location (ideally with a "browse" button) and enter a prefix and automatically save the images when the user clicks capture.

Best Answer

  • Options
    Answer ✓
    David,

    The capture commands have many more parameters than what is recorded by default. You can make them appear by clicking "Display All" in the Properties panel when looking at the macro in design view.

    image

    You can also ask to record all in order to see them in code view, or just add the few that matter:

        Public Function NewMacro() As SimpleScript
            NewMacro = New SimpleScript
            Dim image1
    
            With Capture.CaptureCommands.Settings(NewMacro)
                .CaptureToFile=True
                .FilePath="D:\"
                .Run()
            End With
    
            With Capture.CaptureCommands.Acquire(NewMacro)
                .Run(Nothing, image1)
            End With
    
        End Function
    
    Then you should be able to insert this code into your app and link it to a browse button. I'll post something separately to show how to browse for a file.

    Pierre

Answers

  • Options
    Thanks, that worked. However, it is strange to me that it didn't record those options that I had explicitly changed during the recording.
  • Options
    Yes there appears to be an issue with the recording of some capture settings changes, I filed a bug and this will be addressed in the next capture patch.
Sign In or Register to comment.