Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4    Statistic  

AppleScript.GetPropertyName

Queries name of property with given index.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
AppleScript 4.2 Yes No Yes, macOS only No No

MBS( "AppleScript.GetPropertyName"; Script ID; Index )

Parameters

Parameter Description Example value
Script ID The Id of the script you want to execute. This ID returned by the AppleScript.Compile function. 1
Index The index of the property from 0 to AppleScript.PropertyCount-1. 0

Result

Returns name or error.

Description

Queries name of property with given index.
Lasterror is set.

Examples

List properties by name:

Set Variable [ $scriptID; Value:MBS( "AppleScript.Compile"; AppleScript Properties::AppleScriptCode ) ]
If [ MBS("isError") ]
    Show Custom Dialog [ Message: MBS("AppleScript.LastErrorMessage"); Buttons: “OK”, “Cancel” ]
    Exit Script [ ]
End If
Set Variable [ $count; Value:MBS( "AppleScript.PropertyCount"; $scriptID) ]
Set Variable [ $list; Value:"" ]
Set Variable [ $i; Value:0 ]
If [ GetAsNumber($count) > 0 ]
    Loop
        Set Variable [ $n; Value:MBS( "AppleScript.GetPropertyName"; $ScriptID; $i ) ]
        Set Variable [ $list; Value:$list & $n & ¶ ]
        Set Variable [ $i; Value:$i+1 ]
        Exit Loop If [ $count = $i ]
    End Loop
    Show Custom Dialog [ Title: $count & " Properties"; Message: $list; Buttons: “OK”, “Cancel” ]
End If
Set Variable [ $r; Value:MBS( "AppleScript.Close"; $scriptID) ]

See also

Created 18th August 2014, last changed 31st October 2016


AppleScript.Execute   -   AppleScript.GetPropertyValue

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos