I fear this discussion has degenerated beyond reasonable bounds, way past anything productive for the original poster and venturing into personal insult territory. You, sir, are wrong. I'm sorry you can't realize that. In the interests of trying to restore civility, though...
Interesting because the OP did ask "terminal output status and store it into a variable once a command has been executed?"
You're right, he did. Your code example (at least the one I was referencing and that you claimed would do so) did not do that. It just didn't.
And I am the ONLY person to provide the method to get "Terminal output... into a variable"
Granted, you did do that, but you didn't solve the OPs problem. He didn't want the contents of the Terminal window, he wanted the output of the command he's using. Your 'solution' still requires text parsing, and also breaks if there's more than one screen's worth of output from the command (for that you need to reference the window's 'history', not its 'content', with all the associated overhead that brings).
In my experience, in 99% of such cases, people use Terminal.app because it's easy and obvious, not realizing that AppleScript has its own, functional method of invoking shell-based tasks.
Indeed, the actual response that got a 'Solved' mark (about 20 minutes after the original post, I might add) did exactly that - used 'do shell script' rather than Terminal. On that basis alone the rest of the discussion could be regarded as moot.
You are attacking the wrong reply of mine. It is not 25 lines, it is 1 line.
I see now which answer you were referring to, so my apologies if I was referencing the wrong reply. I don't see the point of the 25-line script, though...?
Yes, you are correct that you can query the busy flag, and yes, you can get the content (or history) of a window, and yes, you can parse that data to get the output of a shell command, but that is still way more work than a single line in AppleScript. Show me a simple, functional, Terminal.app-based AppleScript that comes close to the ease of 'do shell script' and I'll reconsider my stance.
Applescript has a wonderfull feature called the Dictionairy
Actually, I think it's called the Dictionary.
Read it sometime and you will see it does know when the shell process completes.
Clearly you don't realize how versed I am in AppleScript.
Stop trying to pretend you arnt DEAD WRONG.
I'm not dead wrong. And I believe the contraction is spelled "aren't".
I found this because I wanted to google the same thing as the OP and you told me it was impossible.
I don't believe I used the term 'impossible' anywhere in my posts. hmm.. nope. Not there.
I did say that it is easier, in most cases, to use 'do shell script'. A position I've maintained for years.
I also said that scripting Terminal.app might get you there, but it's more complex in most cases. Another position I've held for years. In fact, now that you've prompted me to go through the entire thread to re-acquaint myself with what was (and was not said) it seems that you seem to have issue with anything that anyone (well, at lesst BobHarris and myself) have to say.
Your wrong
My wrong what? Oh, hang on, did you mean "You're wrong". My bad.
So I provided the answer and corrected you for posting lies.
At most, you provided a partial answer. And I did not lie. Do not accuse me of lying.
Now you throw a hissy fit
I don't think I'm the one having a fit here.
and say I am off topic because I told you AS knows when the shell is completed, as well as how to get the Terminal output in a single line.
I didn't say you were off topic, just that your answer didn't really address the OPs original question or issue.
Semantically, there is a difference between AppleScript 'knowing' something and AppleScript 'being able to go out and find something'. Subtle, maybe, but that's clearly not your concern.
In this instance, AppleScript 'knows' when the script flow continues, or when some external trigger notifies the script (such as 'do shell script' returning some value).
This is intrinsically different from AppleScript repeatedly polling Terminal.app "are you done yet? how about now? now? now...?'
Plus, as I've already stated, there is a difference between 'Terminal output' and the output of the command. They do not equate.
However, it if makes you feel better - you are absolutely, 100% correct that you can use AppleScript to grab the contents of a Terminal.app window. Congratulations. You still didn't solve the OP's question, though.
I'm done.