Maybe there is a built in way to do this in Eggplant, but I want to find the text for the last LogError in my script’s log file.
I don’t know of a built in way to do this.
The Eggplant Reference shows a way to forward iterate through the Errors.
However, I think that it would be slightly more efficient, especially on LARGE log files, to reverse iterate the lines searching for “Error” and then exit repeat.
Is there a built in way to do what I want to do?
Is there a more efficient way to find the list error than:
set lastError to empty set lastScriptResult to the last item of ScriptResults() repeat with each line of file lastScriptResult.LogFile if the first word of it is "Error:" then set lastError to it end repeat