Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

DocumentPicker.SetTrigger

Sets trigger for document trigger.

Component Version macOS Windows Linux Server iOS SDK
FileDialog 9.1 ❌ No ❌ No ❌ No ❌ No ✅ Yes
MBS( "DocumentPicker.SetTrigger"; FileName; ScriptName )   More

Parameters

Parameter Description Example
FileName The file name of the script. Get(FileName)
ScriptName The script to trigger. "FilesSelected"

Result

Returns OK or error.

Description

Sets trigger for document trigger.

Examples

Import file with DocumentPicker:

# set script to call later
Set Variable [ $r ; Value: MBS( "DocumentPicker.SetTrigger"; Get(FileName); "Trigger" ) ]

# allowed list of file types:
Set Variable [ $Types ; Value: "public.jpeg¶public.png" ]

# show import dialog:
Set Variable [ $r ; Value: MBS( "DocumentPicker.Import"; $Types; 0 ) ]

Sample trigger script:

Set Field [ PlaceHolder::Paths ; MBS( "DocumentPicker.Files" ) ]
Set Variable [ $path ; Value: GetValue(PlaceHolder::Paths; 1) ]
If [ Length ( $path ) > 0 ]
    Set Field [ PlaceHolder::Container ; MBS( "Container.ReadFile"; $path; "auto") ]
Else
    Set Field [ PlaceHolder::Container ; "" ]
End If

See also

Example Databases

This function checks for a license.

Created 28th January 2019, last changed 8th July 2020


DocumentPicker.Open - DragDrop.AttachToWindow

💬 Ask a question or report a problem