AppleScript to Determine Whether the Main Window of SnippetsLab is Open

I have an app named SnippetsLab on macOS.

And, setting hide dock icon.

I have tried code like below, but not useful for me.

tell application "System Events"

  delay 3

  -- get frontmost application name
  set theName to name of the first process whose frontmost is true
  log theName

end tell

I need some AppleScript to distinguish it's main window whether show or not.

Hey @Haisen_Ling,

Welcome to the forum!   :smile:

This should work:

tell application "System Events"
   tell application process "SnippetsLab"
      set winList to name of windows
   end tell
end tell

If no window is open the result should be an empty list.