Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

RunTask.NewTask

Creates a new task.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
RunTask 3.1 Yes Yes Yes No No

MBS( "RunTask.NewTask" )

Parameters

none

Result

Returns OK or error.

Description

Creates a new task.
Clears all properties, so you can start fresh.

Please use Shell.New if you need more features.

Examples

Run ls on Mac:

# new task
Set Variable [$r; Value:MBS( "RunTask.NewTask" )]
#set launch path and arguments
Set Variable [$r; Value:MBS( "RunTask.SetLaunchPath"; "/bin/ls" )]
Set Variable [$r; Value:MBS( "RunTask.SetArguments"; "/bin" )]
# run
Set Variable [$r; Value:MBS( "RunTask.Launch")]
# wait
Loop
    Pause/Resume Script [Duration (seconds): ,1]
    Exit Loop If [MBS( "RunTask.IsRunning" ) ≠ 1]
End Loop
# read result
Set Variable [$data; Value:MBS( "RunTask.ReadOutputText"; "UTF-8" )]
Show Custom Dialog ["Result"; $data]

Run shell script in bash:

Set Variable [$r; Value:MBS( "RunTask.NewTask" )]
Set Variable [$r; Value:MBS( "RunTask.SetLaunchPath"; "/bin/bash" )]
Set Variable [$r; Value:MBS( "RunTask.SetArguments"; "/Users/cs/Desktop/test.sh"; "First Param" )]
Set Variable [$r; Value:MBS( "RunTask.Launch")]

See also

Example Databases


RunTask.Launch   -   RunTask.ProcessIdentifier

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins