Understanding AppleScript UI-Scripting to Click Menus

No, because windows are "contained by" applications so you have to refer to the application as well. You can do that explicitly, as @CJK did, or implicitly by putting it inside a tell application... block.

Using TextEdit as an example:

name of window 1 of application "TextEdit"

or

tell application "TextEdit"
	name of window 1
end tell
1 Like