applescriptconstant(
VALUE
)

The applescriptconstant( function converts an expression into an AppleScript literal.


Parameters

This function has one parameter:

value – value to be encoded. This value may be text, in which case it will be properly quoted. Any special characters in the text will be escaped. The value may also be numeric, in which case it is passed thru “as-is”.


Description

This function converts an expression into an AppleScript literal. If the formula value is text, the function surrounds the text with double quote characters, and escapes any double quote and/or backslash characters within the text. If the value is numeric it is simply converted to text.

applescriptconstant("Hello World") ☞ "Hello World"
applescriptconstant("He said ""hello"" then he left") ☞ "He said \“hello\“ then he left"
applescriptconstant(3264) ☞ 3264

Note: This function is equivalent to:

?(expressiontype(theformula)=0,{"}+replace(replace(str(theformula),
    {\},{\\}),{"},{"})+{"},str(theformula))

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.