DynaPDF.GetJavaScript
---------------------

Returns a global JavaScript as string.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [13.2](newinversion132.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.GetJavaScript"; PDF; Index or Name ) 

**MBS**( **"DynaPDF.GetJavaScript";** /\* Returns a global JavaScript as string. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Index or Name**) /\* Pass either text with the name of the JavaScript or the index in range from 0 to [DynaPDF.GetJavaScriptCount](DynaPDFGetJavaScriptCount.md)-1.e.g. "test" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Index or Name | Pass either text with the name of the JavaScript or the index in range from 0 to [DynaPDF.GetJavaScriptCount](DynaPDFGetJavaScriptCount.md)-1. | "test" |

### Result

Returns text or error.

### Description

Returns a global JavaScript as string.   
The parameter Index must be a valid handle of a global JavaScript or the name.  
To enumerate all JavaScripts of a document use the function [DynaPDF.GetJavaScriptCount](DynaPDFGetJavaScriptCount.md) and then run a loop calling this function.  
  
See also [GetJavaScript](https://www.monkeybreadsoftware.com/DynaPDF-Manual/GetJavaScript.shtml) function in DynaPDF manual.

### Examples

Query the JavaScript of the thing we added:

 Set Variable \[ $r ; Value: MBS ("[DynaPDF.AddJavaScript](DynaPDFAddJavaScript.md)"; $pdf ; "test"; "function test() { return 123; }") \]   
Set Variable \[ $name ; Value: MBS ("DynaPDF.GetJavaScript"; $pdf ; "test") \]  
### See also

- [DynaPDF.AddJavaScript](DynaPDFAddJavaScript.md)
- [DynaPDF.ChangeJavaScript](DynaPDFChangeJavaScript.md)
- [DynaPDF.ChangeJavaScriptAction](DynaPDFChangeJavaScriptAction.md)
- [DynaPDF.ChangeJavaScriptName](DynaPDFChangeJavaScriptName.md)
- [DynaPDF.CheckFieldNames](DynaPDFCheckFieldNames.md)
- [DynaPDF.DeleteJavaScripts](DynaPDFDeleteJavaScripts.md)
- [DynaPDF.GetJavaScriptAction](DynaPDFGetJavaScriptAction.md)
- [DynaPDF.GetJavaScriptName](DynaPDFGetJavaScriptName.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetFieldName](DynaPDFSetFieldName.md)

### Release notes

- **Version 13.2**
    - Added [DynaPDF.AddJavaScript](https://www.mbsplugins.eu/DynaPDFAddJavaScript.shtml), [DynaPDF.ChangeJavaScript](https://www.mbsplugins.eu/DynaPDFChangeJavaScript.shtml), [DynaPDF.ChangeJavaScriptAction](https://www.mbsplugins.eu/DynaPDFChangeJavaScriptAction.shtml), [DynaPDF.ChangeJavaScriptName](https://www.mbsplugins.eu/DynaPDFChangeJavaScriptName.shtml), [DynaPDF.GetActionCount](https://www.mbsplugins.eu/DynaPDFGetActionCount.shtml), [DynaPDF.GetJavaScript](https://www.mbsplugins.eu/DynaPDFGetJavaScript.shtml), [DynaPDF.GetJavaScriptAction](https://www.mbsplugins.eu/DynaPDFGetJavaScriptAction.shtml), [DynaPDF.GetJavaScriptName](https://www.mbsplugins.eu/DynaPDFGetJavaScriptName.shtml).

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr3](https://www.mbsplugins.de/archive/2023-04-20/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 15th April 2023 , last changed 15th April 2023

  
[DynaPDF.GetJPEGQuality](DynaPDFGetJPEGQuality.md) - [DynaPDF.GetJavaScriptAction](DynaPDFGetJavaScriptAction.md)

[HTML Version](DynaPDFGetJavaScript.shtml)