I found a several articles explaining how to scroll an NSTextView to the end, but I didn’t find any that explained how to do it only if it was already at the end before new text was appended.
Consider this scenario. You have an NSTextView scrolled to the end and as new text appears in the window, you want to see the new text immediately, so it scrolls to the very bottom for you. Now you decide you want to read some text further up, so you scroll the text upwards. As you’re reading, new text gets appended and suddenly it all scrolls down to the bottom again, causing you to lose your place.