Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DocumentPicker.SetTrigger
Sets trigger for document trigger.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
FileDialog | 9.1 | ❌ No | ❌ No | ❌ No | ❌ No | ✅ Yes |
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