How to determine the Image Name

Hi all,

I wanted to know if I can determine how the name of an image is displayed on its tab. So in my case it is the full file name including extension. But I have seen it without extension for other users.

I need to know this because I am referencing ThisApplication.ActiveImage.Name in my script and I realized that it depends on how the user has set the appearance.

I appreciate any help!

Best regards,
Helga

Best Answer

  • YuriG
    edited October 2024 Answer ✓
    Hi Helga,

    There are different objects based on McImage and names may look different. The name in the tab is McWindow.Caption. You can check all of them using this macro:
        Public Sub Test1
            Debug.Print "Image Name ="  & ThisApplication.ActiveImage.Name
            Debug.Print "Image Display Name ="  & ThisApplication.ActiveImage.DisplayName
            Debug.Print "Document Display Name ="  & ThisApplication.ActiveDocument.DisplayName
            Debug.Print "Window Display Name ="  & ThisApplication.ActiveWindow.Caption
        End Sub
    
    The output may look like this:

    Image Name =SPOTS_TIF0
    Image Display Name =SPOTS.TIF
    Document Display Name =SPOTS.TIF
    Window Display Name =SPOTS.TIF:2 

    So, be aware that the Window Caption can be different from Image.Name.

    Regarding the display of file extension in the tab: it depends on Windows Explorer Property "Hide Extensions for known file types":


    Yuri

Answers

  • Yuri, Thank you. That is interesting info. Haven't been aware of the differences and especially not about the folder properties that are reflected in Image Pro.

    Best regards,
    Helga