Hello and welcome.
You can use wmctrl to list open windows and filter out the thunar ones. However, by default, thunar only displays the folder name in the title bar, not the full path name.
So, to have thunar display the full path name in the title bar (so that you can grab this info), you need to enable a hidden setting:
Code:
xfconf-query -c thunar -n -p /misc-full-path-in-title -t bool -s true
Then, you can use wmctrl to list all open windows:
...and to show only thunar windows (filter by 'File Manager'):
Code:
wmctrl -l | grep "File Manager"
...and if you want to grab all of the current paths of all of the open thunar windows:
Code:
wmctrl -l | grep "File Manager" | awk '{ print $4 }'