AppleScript Editor, write message to the "Result" window

MacosLoggingApplescript

Macos Problem Overview


I am using the Mac OS X Apple Script Editor and (while debugging) instead of writing a lot of display dialog statements, I'd like to write the results of some calculation in the window below, called "Result" (I have the German UI here, so the translation is a guess). So is there a write/print statement that I can use for putting messages in the "standard out" window? I am not asking to put the messages in a logfile on the file system, it is purely temporary.

Macos Solutions


Solution 1 - Macos

You can use the log command, which puts messages into the Log History window, e.g.:


enter image description here

Solution 2 - Macos

Log is the correct way of doing this; however, if your user base is more familiar with shell script you can do the following.

set val to 123
do shell script "echo The value: " & val

Output

Result:
"The value: 123"

With this approach you don’t constantly have to telling users that they need to enable ‘Show Log’

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontopskipView Question on Stackoverflow
Solution 1 - MacosPaul RView Answer on Stackoverflow
Solution 2 - MacoscageView Answer on Stackoverflow