"Copy to Clipboard" tree representation when expanded folders enabled

If you're going to write a script for it, this other script I made might have some logic in there that might be helpful: Script for copying selected relative file paths list from Flat View

It's for a different purpose and only works with selected files, but some of it will be relevant like how it gets the relative paths. You could also subtract the sourcePathDepth and initialDepth variables to calculate the length of the tree branches for each file for example.

Edit: Actually I gave ChatGPT my original script and told it to generate a new one that draws a tree instead, and it actually worked :skull: I'll probably touch it up a bit with additional features when I get the chance and make a thread for it, but I'll paste it below. At the moment it only works with selected files/folders but I'll see about adding stuff to give it the expanding options you mentioned. Also right now it seems to draw the tree a bit funky with an extra layer of lines at the bottom level of selected files.

Edit 2: I polished up the script, here's a thread with it: Script / Command for copying tree view of selected files & folders