0

I've always counted windows using this command:

set windowsnumber to count windows

Now I'm in the need of counting windows that contain a specific string.

E.g. If a process has 5 windows opened (windows "A", "B", "A", "C", "D"), I need something like "count windows that contains "A" in their title", should return 2 in this example.

Is this feasible with applescript?

Giorgio
  • 1,603
  • 5
  • 29
  • 52

1 Answers1

2

Use the whose filter :

set windowsnumber to count (windows whose title contains "A")
jackjr300
  • 7,111
  • 2
  • 15
  • 25