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
0
Best 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_TIF0Image Display Name =SPOTS.TIFDocument Display Name =SPOTS.TIFWindow Display Name =SPOTS.TIF:2So, 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":
Yuri0
Answers
Best regards,
Helga