Applescript causes long error messages to be logged in system.log I have this very simple script...

tell application "System Events"
    set activeApp to short name of first process whose frontmost is true
end tell

tell application activeApp
    repeat 5 times
        display dialog "Hello world" giving up after 2
        delay 2
    end repeat
end tell


and it works fine, but every time the dialog is displayed the following errors are logged,

27/07/15 8:32:48 PM    AppleScript Editor[43002]   -[NSCarbonWindowFrame aspectRatio]: unrecognized selector sent to instance 0x116411470

27/07/15 8:32:48 PM    AppleScript Editor[43002]   HIToolbox: ignoring exception '-[NSCarbonWindowFrame aspectRatio]: unrecognized selector sent to instance 0x116411470' that raised inside Carbon event dispatch
( 
.... trace ....
)

which is flooding my system log. This happens regardless of the active application.

Any idea why and how to stop the errors?
I just discovered that a nested tell will stop the errors, ie

tell application "System Events"
    set activeApp to short name of first process whose frontmost is true
    tell application activeApp
        repeat 5 times
            display dialog "Hello world" giving up after 2
            delay 2
        end repeat
    end tell
end tell


Still don't know why though...