Examples of running AppleScript from JavaScript
InDesign not authorised to send Apple events to other apps
Excel and AppleScript
Count total number of pixels in the image (using image events)