Many of the posts on this blog include fully-functional sample scripts.

To use these sample scripts, you must copy–paste them into a text editor such as Notepad (not into a word processor!) and then save them with a .jsx extension.

The resulting .jsx file must be placed into InDesign’s Scripting folder. The script will then appear inside the scripts panel in InDesign, and you can double-click on it to run.

Here’s an example:

// Select all this text.
// Copy–paste it into a text editor.
// Save with a .jsx extension.
// Place into the InDesign Scripting folder on your harddrive.
// Double-click on it in the InDesign scripts panel.
alert("Success!");