// put clipboard content in variable
put remoteClipboard() into text
// split clipboard items into discrete lines using "
" as delimiter
split text by "
"
repeat with error_text = each item in text
LogError error_text
end repeat
EPJoK, with your hint i have searched this way in the pdf-manual. End there i found this solution:
put RemoteClipboard() into text
// split clipboard items into discrete lines using "
" as delimiter
split text by "
"
repeat with each line of text
LogError it
end repeat
interestingly this will put an “(”-character as first character of the first LogError-line and after the last LogError-line will be an “)”-character.
It seems that this works!
Or is this not a good solution, what do you mean?
Here’s a little explanation that may help you to understand what’s happening:
When you log something containing return characters, Eggplant converts the returns to "
" characters in the log file to keep it as a single line. This is important because the structure of the log file needs to keep each entry on a single line.
The value returned by the remoteClipboard() function in your case contains multiple lines, but the return characters separating the lines haven’t been converted to "
" yet, so splitting the text by that value doesn’t actually split it up, it just turns it into a list containing one item (the entire text). The parentheses you’re seeing are a result of it being a list.
So, the solution you really want is a bit simpler – just eliminate the split command, and log each line separately:
put RemoteClipboard() into text
repeat with each line of text
LogError it
end repeat