CURL.SetFinishedScript
----------------------

Sets which script to call when a transfer finished.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [5.2](newinversion52.md) | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes |

MBS( "CURL.SetFinishedScript"; curl; FileName; ScriptName ) 

**MBS**( **"CURL.SetFinishedScript";** /\* Sets which script to call when a transfer finished. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$FileName**; /\* The database file name where the script is located.e.g. "test.fmp12" \*/   
**$ScriptName**) /\* The script name.e.g. "MyScript" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| FileName | The database file name where the script is located. | "test.fmp12" |
| ScriptName | The script name. | "MyScript" |

### Result

Returns OK or error.

### Description

Sets which script to call when a transfer finished.  
Works with [CURL.Perform](CURLPerform.md), [CURL.PerformAsync](CURLPerformAsync.md) and [CURL.PerformInBackground](CURLPerformInBackground.md).  
  
Does not work on server due to missing capability to trigger scripts in the plugin SDK with FileMaker Server.  
The finish script and evaluate run after failed/succeed scripts and evaluates.  
  
  
With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.  
  
Notice: FileMaker 19.2 adds a fmplugin extended privileges. If you have such an extended privileges to allow the plugin to trigger scripts, you need to grant permissions for it. If such a privilege is not defined, the plugin is allowed to trigger scripts. See FileMaker product documentation for details.  
### Examples

Start a curl session and setup a few scripts:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
Set Variable \[$r ; Value:MBS ("CURL.SetFinishedScript"; $curl ; Get(FileName); "DownloadFinished")\]  
Set Variable \[$r ; Value:MBS ("[CURL.SetProgressScript](CURLSetProgressScript.md)"; $curl ; Get(FileName); "ProgressScript")\]  
### See also

- [CURL.GetFinishedScriptName](CURLGetFinishedScriptName.md)
- [CURL.New](CURLNew.md)
- [CURL.Perform](CURLPerform.md)
- [CURL.PerformAsync](CURLPerformAsync.md)
- [CURL.PerformInBackground](CURLPerformInBackground.md)
- [CURL.SetFailedScript](CURLSetFailedScript.md)
- [CURL.SetProgressScript](CURLSetProgressScript.md)
- [CURL.SetTag](CURLSetTag.md)

### Example Databases

- [ChatGPT](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/ChatGPT.shtml#1ScriptAnchor_)
- [CURL/CURL and OnWindowTransaction](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20and%20OnWindowTransaction.shtml#1ScriptAnchor_)
- [CURL/CURL Download in Background](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20in%20Background.shtml#7ScriptAnchor_)
- [CURL/Download Async](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Download%20Async.shtml#1ScriptAnchor_)
- [CURL/MQTT](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/MQTT.shtml#1ScriptAnchor_)

### Blog Entries

- [Using ChatGPT in FileMaker](https://www.mbsplugins.de/archive/2024-10-16/Using_ChatGPT_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [MQTT in FileMaker](https://www.mbsplugins.de/archive/2024-06-25/MQTT_in_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Background Log Custom function](https://www.mbsplugins.de/archive/2024-01-09/Background_Log_Custom_function/monkeybreadsoftware_blog_filemaker)
- [Send Audit Log via CURL in background](https://www.mbsplugins.de/archive/2023-11-30/Send_Audit_Log_via_CURL_in_bac/monkeybreadsoftware_blog_filemaker)
- [How long do you wait for Insert From URL to finish?](https://www.mbsplugins.de/archive/2023-10-10/How_long_do_you_wait_for_Inser/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2024, Seite 18](https://filemaker-magazin.de/neuigkeit/4257-Appetithappen-FMM_202402)

This function is free to use.

Created 12nd July 2015 , last changed 27th December 2023

  
[CURL.SetFinishedEvaluate](CURLSetFinishedEvaluate.md) - [CURL.SetInputFile](CURLSetInputFile.md)

[HTML Version](CURLSetFinishedScript.shtml)