Error in the program or in the docs?

Panorama X Help ( and in Panorama 6 ) shows applescript({

In both versions of the software, the compiler wants a space: applescript ({

This compiles and works:

applescript ({tell app “Address Book” to get name of every person})
Message ScriptResult[1,100]

Without the space, it does not.

BTW, two scripts below are the same thing, so for me, the pipes make complex scripts easier to put together. Is there any difference I’m overlooking?

applescript ({tell app “Address Book” to get name of every person})

applescript |||tell app “Address Book” to get name of every person|||

The error is in the docs. The example isn’t a full statement. AppleScript( is a function, so a full statement should look something like

ScriptResult=applescript({tell app "Address Book" to get name of every person})

When you put the space in there, you are using the AppleScript statement. The parentheses are superfluous in that case.

Looking at the documentation for some other custom functions, it seems that the standard is to show an example of the function and its result, rather than an example of its use in a line of code. That being the case, I don’t think it’s an error in the docs.

This is because functions can be used in places other than in procedure code, for example in the formula of a graphic object.

And I suggest that the present style of examples is more clear-cut than any other - the reader’s focus is solely on the function and the finger pointer is a neat way of showing the outcome.

Agreed, but which is correct, the docs or the program? Is there to be a space after “Applescript” or not?

THAT was the question.

If you use the Applescript statement you would use it as:

Applescript {tell app “Address Book” to get name of every person}
Message ScriptResult[1,100]

Now if you use the applescript( function you would use it as:

local ScriptResult
ScriptResult=applescript({tell app “Address Book” to get name of every person})
message ScriptResult

There is an AppleScript statement and an AppleScript( function. The statement, like all statements, requires a space afterward. The function, like all functions, requires NO space. There are two documentation pages, if you want to use the statement, look at that page

if you want to use the function, make sure that you look at that page.