I spent quite some time trying to figure out how to integrate latexindent (what a nice tool by the way!) in TeXShop. I was quite surprised to see that there was no solution out of the box (latexindent is now quite standard and is integrated by default in several IDE, like latex-workshop on VSCode or TeXiFy in IntelliJ's).
So I ended up writing up my own AppleScript to format my code with latexindent with a simple shortcut (
Cmd + I for me). The operation can be reverted with
Cmd + Z (this would not be the case if one modifies the .tex file directly using an external script).
Since this could be of some use for someone else, I'm posting it here. It's my first time with AppleScript (and macros in TeXShop more generally) so I would be very happy to have some feedback or suggestions to improve this functionality.
Also, if I missed an already existing solution, please let me know!