I'm trying to create a MsgBox which returns information for the active window including:
• active window title
• directory/pathway for the active file
• window screen position
• name of the application executable file
• directory/pathway for the executable file
Here is the script I've got so far but it's missing some things. (Note: The underscores are present to show indents and will be replaced by spaces — unless someone can tell me how to include actual indents in a MsgBox.)
Code: Select all
^F7::
WinGetActiveStats, `Title, Width, Height, X, Y
WinGet, appName, ProcessName
WinGet, filePath, ProcessPath
MsgBox, The active title is:
(Join
`n________"%Title%"
`n
`nThe active file directory/pathway is:
`n________
`n
`nThe window position is:
`n________%X%, %Y%, %Width%, %Height%
`n
`nThe application executable file is:
`n________%appName%
`n
`nThe executable file is located here:
`n________%filePath%
)
Return
Syntax:
WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]
Comments:
ThanksCmd is the operation to perform, which if blank defaults to ID. It can be one of the following words:
...
ProcessName: Retrieves the name of the process (e.g. notepad.exe) that owns a window. If there are no matching windows, OutputVar is made blank.
ProcessPath [v1.1.01+]: Similar to ProcessName, but retrieves the full path and name of the process instead of just the name.
...
PS Also, which term (pathway or directory) is most appropriate where I have included both of them above?