JavaScript snippets

Calculate dynamic text with a Code snippet that explicitly runs JavaScript. The calculated value is inserted in place of the code.

How to do it

  1. Create a Code snippet and enable Execute as JavaScript code in its settings.
  2. Start with a small expression. The final evaluated value becomes the output.
  3. Use Preview and confirm the result before inserting it in another app.
  4. When adding macro input, handle text and numbers deliberately. Unescaped text can change the meaning of JavaScript code.

Tips and limitations

  • Ordinary Code snippets are not executed unless execution is enabled.
  • Only run code you understand. Do not treat this feature as a full browser or Node.js environment.
  • The examples below are calculations, not secure password generators or live currency services.

Example

Calculate a total

const quantity = 3;
const unitPrice = 12.5;
(quantity * unitPrice).toFixed(2);

37.50

Build a numbered list

["Review draft", "Collect feedback", "Send update"]
  .map((item, index) => `${index + 1}. ${item}`)
  .join("\n");

1. Review draft 2. Collect feedback 3. Send update

This download is for macOS

This app is designed for Mac computers. The .dmg installer can only be used on macOS. Do you want to download it anyway?