Code Editor

The Code Editor is where you write and edit your macros using the Mini Mouse Macro scripting language. This guide provides an overview of the Code Editor’s features and functionality.

Note: The code editor is not yet completed and is still in development. Upon completion, the code editor will provide a full-featured scripting environment for writing and editing macros, which will seamlessly integrate with the Mini Mouse Macro application.

The editor is missing elements of syntax highlighting, code completion, and menu bar functionality. (Jan 11 2025 - last updated)

To see the current state of the code editor, please see the demo below.
Table of Contents
  1. Code Editor Interface
  2. Using the Code Editor
    1. Syntax Highlighting
    2. Line Numbers
    3. Auto-Indentation
    4. Code Completion
    5. Find and Replace
    6. Undo and Redo
    7. Keyboard Shortcuts
  3. Code Editor Settings
  4. Code Editor Themes
  5. Code Editor Best Practices
  6. Code Editor Demo

Code Editor Interface

The Code Editor interface consists of the following components:

  1. Menu Bar: Contains options to manage your scripts, such as saving, loading, and running macros.
  2. Toolbar: Provides quick access to common actions like saving, loading, and running scripts.
  3. Code Editor: The main area where you write and edit your scripts.
  4. Status Bar: Displays information about the current script, such as line and column numbers.

Using the Code Editor

The code editor supports syntax highlighting, line numbers, and auto-indentation to help you write and edit scripts more efficiently. Here are some key features of the Code Editor:

Syntax Highlighting

Syntax highlighting colorizes different elements of the script to make them stand out visually. This helps you identify keywords, variables, and comments more easily.

Line Numbers

Line numbers are displayed on the left side of the editor to help you keep track of your script’s structure. You can quickly navigate to a specific line by clicking on the line number.

Auto-Indentation

The editor automatically indents code blocks to maintain proper formatting and readability. This feature helps you write clean and organized scripts.

Code Completion

Code completion suggests keywords, functions, and variables as you type, making it easier to write scripts without memorizing every command. Press Tab to accept a suggestion.

Find and Replace

You can search for specific text within your script using the Find feature. Additionally, you can replace text with another value using the Replace feature.

Undo and Redo

The editor supports undo and redo functionality, allowing you to revert changes or redo actions as needed. Use Ctrl+Z to undo and Ctrl+Y to redo.

Keyboard Shortcuts

The Code Editor provides various keyboard shortcuts for common actions like saving, loading, and running scripts. You can find a list of available shortcuts in the menu or toolbar.

Code Editor Settings

You can customize the appearance and behavior of the Code Editor by adjusting the settings. Common settings include changing the font size, enabling word wrap, and configuring syntax highlighting colors.

Code Editor Themes

The Code Editor supports different themes to change the appearance of the editor. Themes can alter the color scheme, font style, and other visual elements to suit your preferences.

Code Editor Best Practices

When writing scripts in the Code Editor, consider the following best practices to improve readability and maintainability:

  • Use descriptive variable names to indicate the purpose of each variable.
  • Comment your code to explain complex logic or provide context for future reference.
  • Break down complex tasks into smaller functions or procedures for easier debugging.
  • Test your scripts incrementally to identify and fix issues early in the development process.

By following these best practices, you can create well-structured and efficient scripts that are easier to understand and maintain.

Code Editor Demo

Ace Editor with MMM Mode