WINDOWCOUNT() but just for the current space?

The list is reduced to a single value in the AppleScript. All you need to do is to retrieve that value by following these steps:

  1. Add the Execute an AppleScript action to a macro.

  2. Copy and paste the AppleScript above into that action.

  3. Change ignore results to save value to variable. A Save to variable field will appear.

  4. In the Save to variable field, enter your desired variable name, e.g., local_DesktopSpaceNo.

1 Like