Hi,
When collecting a list of Finder windows in Applescript, every window is listed twice. To test, have some Finder window(s) open and run the following in Script Editor:
tell application "System Events"
set FinderWins to (windows of (processes whose name = "Finder"))
end tell
The result is a nested list with every window listed two times.
Actually this functionality does not touch Finder or TotalFinder. You are asking “System Events” app to give you all windows of a given app. And it works by iterating all visible windows and giving them back. In case of TotalFinder the situation is that it has parent “frame window” and possibly up to two child Finder windows attached to it. System Events returns all of them. In other words it does not iterate only (top-level) non-child windows.
If you create TotalFinder window with dual mode and two distinct tabs, you would see result of three windows. One will have “tab1 | tab2” in name (which is the parent window). I’m now looking into how to distinguish this.
It’s part of a larger window collection where I tried to catch also non-scriptable apps, hence the System Events: “get (windows of (processes whose visible = true) whose value of attribute “AXMinimized” is false)”. Maybe I’ll have to run Finder separately.