The features described in this topic are obsolete
and should not be used in new IDL code.

DO_APPLE_SCRIPT

This routine is obsolete and should not be used in new IDL code.

The DO_APPLE_SCRIPT procedure compiles and executes an AppleScript script, possibly returning a result. DO_APPLE_SCRIPT is only available in IDL for Macintosh.

Syntax

DO_APPLE_SCRIPT, Script [, /AG_STRING] [, RESULT=variable]

Arguments

Script

A string or array of strings to be compiled and executed by AppleScript.

Keywords

AS_STRING

Set this keyword to cause the result to be returned as a decompiled string. Decompiled strings have the same format as the "The Result" window of Apple's Script Editor.

RESULT

Set this keyword equal to a named variable that will contain the results of the script.

Example

Suppose you wish to retrieve a range of cell data from a Microsoft Excel spreadsheet. The following AppleScript script and command retrieve the first through fifth rows of the first two columns of a spreadsheet titled "Worksheet 1", storing the result in the IDL variable A:

script = [ 'tell application "Microsoft Excel"', $ 
   'get Value of Range "R1C1:R5C2" of Worksheet 1', $ 
   'end tell' ] 
DO_APPLE_SCRIPT, script, RESULT = a 

Similarly, the following lines would copy the contents of the IDL variable A to a range within the spreadsheet:

A = [ 1, 2, 3, 4, 5 ] 
script = [ 'tell application "IDL" to copy variable "A"', $ 
   'into aVariable', $ 
   'tell application "Excel" to copy aVariable to', $ 
   'value of range "R1C1:R5C1" of worksheet 1' ] 
DO_APPLE_SCRIPT, script