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.
            Asked
            
        
        
            Active
            
        
            Viewed 7.6k times
        
    62
            
            
        2 Answers
102
             
    
    
        Paul R
        
- 208,748
- 37
- 389
- 560
- 
                    6If you want to only see the results from your log statements, you can tap the Events and Replies buttons so that they are unhighlighted. – Senseful Oct 20 '13 at 02:01
- 
                    1Hooray broken images from before SO had a deal with Imgur :D – Ky - Feb 09 '16 at 18:27
- 
                    1@BenC.R.Leggiero: thanks for the heads up - I just added a new screen shot. – Paul R Feb 09 '16 at 18:45
- 
                    @theonlygusti: in what way does it not work ? What happens when you get to the `log` statement ? – Paul R Jan 14 '17 at 22:12
- 
                    @PaulR it just doesn't post anything. I was using it (trying to) inside a tell block though. – theonlygusti Jan 14 '17 at 22:15
- 
                    OK - try it on its own first to make sure it works in isolation, perhaps ? – Paul R Jan 14 '17 at 22:21
14
            
            
        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’
 
    
    
        cage
        
- 403
- 1
- 5
- 8
 
    