applescript(
SOURCE
)

The applescript( function executes AppleScript source code and returns the result.


Parameters

This function has one parameter:

source – source code of an AppleScript program. Note: It is very convenient to use “pipe” delimiters for the source code parameter, for example |||code|||. This eliminates needing to worry about the delimiters appearing in the source code itself.


Description

This function executes AppleScript source code and returns the result. Here is a simple example that lists all of the people in your address book.

applescript({tell app "Address Book" to get name of every person})
    ☞ {"Scott Frankel", "John Kuttel", "Jim Cook", "Eric Grunbaum", "Alex Lebosq",
        "Chris Griffin", "Steve Zantos", "Steven Saltman", "Pat Furnare", "Bob Ferrrini",
        "Cheryl Maybee", "Mark de Jong"}

Panorama formulas can be embedded in the AppleScript source code using special tags. To embed a Panorama formula, use

$«formula»$

The formulas are calculated in advance, then embedded into the source code as constants. For example, the formula $«2*3»$ will be embedded into the program as 6. The formula $«upper("hello world")»$ will be embedded as "HELLO WORLD".

In the case of text formulas any special characters will be encoded as necessary for a proper AppleScript constant. For example the formula $«{"}»$ will be embedded as "\“".

To embed a Panorama formula with no quotes or translation, use this format

^«formula»^

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.