Get Window Title
hrodstein
Function/S WindowTitle(WindowName) // Returns the title of a window given its name.
String WindowName // Name of graph, table, layout, notebook or control panel.
String RecMacro
Variable AsPosition, TitleEnd
String TitleString
if (strlen(WindowName) == 0)
WindowName=WinName(0,1) // Name of top graph window
endif
if (wintype(WindowName) == 0)
return "" // No window by that name
endif
RecMacro = WinRecreation(WindowName, 0)
AsPosition = strsearch(RecMacro, " as \"", 0)
if (AsPosition < 0)
TitleString = WindowName // No title, return name
else
AsPosition += 5 // Found " as ", get following quote mark
TitleEnd = strsearch(RecMacro, "\"", AsPosition)
TitleString = RecMacro[AsPosition, TitleEnd-1]
endif
return TitleString
End
String WindowName // Name of graph, table, layout, notebook or control panel.
String RecMacro
Variable AsPosition, TitleEnd
String TitleString
if (strlen(WindowName) == 0)
WindowName=WinName(0,1) // Name of top graph window
endif
if (wintype(WindowName) == 0)
return "" // No window by that name
endif
RecMacro = WinRecreation(WindowName, 0)
AsPosition = strsearch(RecMacro, " as \"", 0)
if (AsPosition < 0)
TitleString = WindowName // No title, return name
else
AsPosition += 5 // Found " as ", get following quote mark
TitleEnd = strsearch(RecMacro, "\"", AsPosition)
TitleString = RecMacro[AsPosition, TitleEnd-1]
endif
return TitleString
End
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More