> For the complete documentation index, see [llms.txt](https://docs.klai.studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klai.studio/getting-started/ide-quick-tour/environment/pages-deep-dive/page-action-scripts.md).

# Working with Page-Level Action Scripts

This tab is for managing <mark style="color:red;">local actions</mark> within the current page. You can:

* Create new scripts by clicking "+ New Script" in the first panel.
* The second panel shows your current script, where you can:
  * Add actions
  * Rearrange actions via drag-and-drop
* Edit action details in the third panel.
* **JavaScript Editor**: If you have a `"function"` action, click the gutter / line number next to the `function` key to open the JavaScript editor.
* **Disabled**: Temporarily disable a script without deleting it.
* **Run**: Execute the script immediately for testing purposes.
* **Delete**: Permanently remove the script.

By organizing your logic into named scripts, you can create more modular, reusable, and maintainable actions within your BetterForms pages.

For example, when a `function` action is selected in the script editor, clicking the line number next to the `function` key opens the JavaScript editor modal:

<figure><img src="https://701607561-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LKI28WjQukQ2x6JNpYA-887967055%2Fuploads%2F7Ga4FX1JARLUR1lOrgVd%2FScreenshot%202024-08-23%20at%204.55.56%E2%80%AFPM.png?alt=media&amp;token=7c10e4df-2296-4e69-8ec2-84f5e4ea20fd" alt="Click the line number next to the function key to open the JavaScript editor"><figcaption></figcaption></figure>

{% hint style="info" %}
**Priority of Local Scripts**: Local scripts take priority over global scripts. For example, if both local and global scripts define a namedAction `"someAction"`, the local script will be executed on this page.
{% endhint %}
