Home Image-Pro Plus Automation with Macros

How can I get the name of the open file into a string variable?

Hi there
 I have designed a Macro in which I do some measurements in some images and I want to automatically save the measurement files (*.iqm) into the same folder with the same name of the file. However to do that I need to put together the PATH of the image and the NAME of the image and the iqm extension to then save the measurement file.

Any help would be highly appreciated.

Best Answer

  • Options
    Answer ✓
    Hi David,

    When you save an image to a TIF file, the measurements are saved together with the file, so it's not necessary to save a separate IQM file.
    But if you need it anyway, you can get the image file name using ThisApplication.ActiveDocument.FileName or ThisApplication.ActiveImage.File.FullPathName. 
    Check this post for an example: http://forums.mediacy.com/discussion/comment/237#Comment_237 .



  • Options
    Hi Yuri

    I do not want to modify the original JPG images, since they belong to a bigger project and many people uses them. The measurement files are enough.

    I read the post in the link and it solved the problem.

    Thank you very much!
Sign In or Register to comment.