Home Image-Pro Plus Automation with Macros

How to choose directory of files to analyze

(Originally posted by briere on 2/25/2007)

I am writing a macro to analyze all images in a directory and subdirectory. I would like the user be able to choose the directory by browsing and not by typing the full path. I tried IpWsGetName, but it works only for files not for directory. How is it possible to do that with IpBasic ?

 

Comments

  • edited June 2013

    (Originally posted by KevinR on 2/26/2007)

    Try the following:

    
    Function GetDirectory() As String
    	Dim dirName As String, destName As String
    	Dim demarkation As Integer
    	
    	GetDirectory = ""
    	dirName = GetFilePath("Destination folder", "", "C:\", "Go to the desired folder", 3)
    
    	If dirName = "" Then
    		Exit Sub
    	End If
    
    	demarkation = InStrRev(dirName, "\")
    	destName = Left(dirName, demarkation)
    	GetDirectory = destName
    	
    End Function
    


    You can customize this some more by passing in a starting directory and a prompt, as desired.

     

     

  • Hello

    How to create a macro in image pro plus 6 for measuring the area of all images in a directory.

    Thank You

    Carlos
  • edited July 2015
    Hi Carlos,

    Multi-image processing can be done using batch macro (Batch_Process.ipm), you can find that macro in the Scripts folder.

    There are some posts on this forum related to batch processing, you can search for it using "batch" key word.

    Here are some links: 
    http://forums.mediacy.com/discussion/comment/304/#Comment_304
    http://forums.mediacy.com/discussion/comment/1215/#Comment_1215
    http://forums.mediacy.com/discussion/comment/542/#Comment_542

    Regards,

    Yuri
Sign In or Register to comment.