setappleeventvalue
VALUE

The setappleeventvalue statement may be used in a procedure that responds to an AppleEvent (this includes AppleScript programs), the statement specifies the value to be returned by the event.


Parameters

This statement has one parameter:

value – is the value to return to the calling event/program. This value may be either text or numeric. Dates and binary values are not allowed, and integer values larger than 32 bit are not allowed.


Description

Use the SetAppleEventValue statement to return a value from Panorama to AppleScript. This AppleScript finds out the number of selected records in the current database and displays that in a dialog.

tell application "PanoramaX"
    set recordCount to run code "setappleeventvalue info({selected})"
end tell
display dialog recordCount

Working with Lists

One of AppleScript’s powerful features is the List data type. Panorama does not directly support the list data type, but you can easily convert between Panorama text arrays and lists, and back again.

Here is an example that transfers a text array to an AppleScript variable and then converts that variable into a list.

tell application "PanoramaX"
    set databaseFields to run code "setappleeventvalue dbinfo({fields},{})"
end tell
set AppleScript's text item delimiters to return
set databaseFields to every text item of databaseFields

This can be rearranged into a simpler version:

tell application "PanoramaX"
    set AppleScript's text item delimiters to return
    set databaseFields to every text item of (run code "setappleeventvalue dbinfo({fields},{})")
end tell

See Also


History

VersionStatusNotes
1.0NewNew in this version.