How can I script selective minimization of documents in text edit when several files may be open?
Open the windows you want to minimize first, and the other(s) afterwards.
open -a TextEdit.app ~/Documents/doc2.txt ~/Documents/doc3.txt
osascript -e 'tell application &quot;TextEdit&quot; to set miniaturized of every window to true'
open -a TextEdit.app ~/Documents/doc1.txt