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.
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
Code Editor Interface
The Code Editor interface consists of the following components:
- Menu Bar: Contains options to manage your scripts, such as saving, loading, and running macros.
- Toolbar: Provides quick access to common actions like saving, loading, and running scripts.
- Code Editor: The main area where you write and edit your scripts.
- 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.