Skip to content

Mix Script User Manual

What is Mix Script

Mix Script is a powerful automation tool that helps you:

  • 🚀 Automatically launch multiple applications
  • 💻 Execute system commands in batches
  • 🌐 Quickly open frequently used URLs
  • 📁 Automate file operations
  • ⌨️ Simulate keyboard and mouse actions
  • ⏰ Execute complex tasks in sequence

Create Your First Script

Step 1: Enter Mix Script Category

  1. Click "Mix Script" in the left menu bar.
  2. Select a sub-category (e.g., "My Scripts").

Step 2: New Script

  1. Right-click on an empty area.
  2. Select "New Script".
  3. Fill in the script name and description.

Step 3: Add Actions

  1. Click the "Add Action" button.
  2. Choose from 8 types of actions.
  3. Configure action parameters.
  4. Repeat to add more actions.

Supported Action Types

1. Launch App

Open applications, files, or folders.

  • App Path: C:\Program Files\VSCode\Code.exe
  • Launch Arguments: --new-window
  • Working Directory: C:\Projects\MyApp

2. System Command

Execute CMD or PowerShell commands.

bash
# Clear temporary files
del /q /f %temp%\*

# Start service
net start MySQL

# Check port usage
netstat -ano | findstr :8080

3. Open URL

Open a specified URL in the browser.

  • URL: https://www.example.com
  • Specify browser (optional)

4. File Operation

Copy, move, delete, or rename files/folders.

  • Operation Type: Copy, Move, Delete, Rename
  • Source Path: C:\Source\file.txt
  • Target Path: D:\Backup\file.txt

5. Delay Wait

Pause script execution and wait for a specified time.

  • Delay Duration: In milliseconds (1 second = 1000 ms)
  • Recommended Delay: 2-5 seconds for apps, 1-3 seconds for webpages.

6. Keyboard & Mouse

Simulate keyboard key presses or mouse operations.

  • Key: Enter, Ctrl+C, Alt+Tab
  • Click: Left, Right, Middle
  • Coordinates: Screen X, Y positions

7. Run Code Advanced

Run code directly in the script, supporting network API calls, data scraping, file processing, and other complex tasks.

Supported Languages

LanguageDescriptionRecommended
JavaScriptBuilt-in modules like axios, cheerio, no installation required⭐⭐⭐ Recommended
PythonRequires Python to be installed on your system⭐⭐
PowerShellWindows built-in

Built-in JavaScript Modules

The following modules can be used directly with require(), no installation required:

ModulePurposeExample
axiosHTTP Requestaxios.get('https://api.example.com')
cheerioHTML Parsingcheerio.load(html)
fsFile I/Ofs.readFileSync()
pathPath processingpath.join()

Common API Examples

Get Bilibili Trending Videos:

javascript
const axios = require('axios');
const res = await axios.get('https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1');
const videos = res.data.data.list.map(v => ({
  Title: v.title,
  Uploader: v.owner.name,
  Views: v.stat.view
}));
console.log(JSON.stringify(videos, null, 2));

Get Weather Info:

javascript
const axios = require('axios');
const res = await axios.get('https://wttr.in/Beijing?format=j1');
const weather = res.data.current_condition[0];
console.log(`Beijing Weather: ${weather.weatherDesc[0].value}, Temperature: ${weather.temp_C}°C`);

Get Stock Market Gainer List:

javascript
const axios = require('axios');
const url = 'https://push2.eastmoney.com/api/qt/clist/get?fs=m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23&fields=f12,f14,f2,f3,f4,f5&pn=1&pz=10&fid=f3&po=1';
const res = await axios.get(url);
console.log(JSON.stringify(res.data.data.diff, null, 2));

Mixstart Built-in Functions

You can call Mixstart.saveFile() in the script to pop up a save dialog:

javascript
const data = { ... }; // Your fetched data
const content = JSON.stringify(data, null, 2);

// Pop up "Save File" dialog
const result = await Mixstart.saveFile(content, 'output.json', [
  { name: 'JSON File', extensions: ['json'] },
  { name: 'All Files', extensions: ['*'] }
]);

if (result.success) {
  console.log('File saved to:', result.filePath);
}

Use Cases

  • Periodic data scraping: Get stock/trending video info every day.
  • Batch data processing: Format conversion, data cleaning.
  • Automated reports: Save files after fetching data.

8. Flow Control Advanced

Supports complex logic judgments and loops.

  • Conditional: If file exists execute..., if app is running...
  • Loop: Repeat an action sequence N times.
  • Variables: Set and read variables to pass data between actions.

9. Interaction & Reminders

  • Show Notification: Pop up a system notification in the bottom-right corner. Supports custom titles and content.
  • Scheduled Reminder: Create a one-time system alarm. Supports natural language time parsing (e.g., "in 10 minutes", "14:30").
  • User Dialog: Displays a confirmation or selection box to branch the script's execution flow based on user choice.

10. Run OpenClaw Plugin Core Enhancement

Allows direct invocation of a vast array of OpenClaw plugins from the marketplace (e.g., PDF conversion, image compression, multimedia processing).

  • Plugin Slug: The unique ID of the plugin.
  • Input Source:
    • Direct: Manually entered text.
    • Clipboard ($clipboard): Automatically extracts system clipboard content at execution time.
    • Custom Input ($custom): Input via the action configuration panel.
  • Parameter Injection: Supports injecting mandatory parameters (e.g., API keys, processing formats) defined by the plugin into the execution context.
  • Intelligent Interaction Interception:
    • If a plugin is missing required parameters or the input source is the clipboard, the system will automatically pop up a configuration panel for user confirmation/input before proceeding.

11. Window Operation

Directly control desktop windows via Windows API without manual clicking. Supports target window identification via exact/fuzzy title matching.

  • Operation Types: Maximize, Minimize, Restore, Topmost, Focus, Close.
  • Matching Logic: Supports keyword searches. For example, entering VS Code will control any window whose title contains that string.

12. HTTP Request

Initiate network requests directly for integration with third-party webhooks or internal system APIs.

  • Methods: GET, POST, PUT, DELETE.
  • Configurations: Supports URL, custom Headers (via JSON), timeouts, and Body data.
  • Output Capture: Response results can be passed to subsequent text processing or notification actions.

13. System Control

Quickly execute system-level operations with support for delayed execution and forced execution.

  • Options: Shutdown, Restart, Lock, Sleep, Logout.
  • Scenario: e.g., "Lock computer after backup is complete."

14. Clipboard Operation

Automate system clipboard data management.

  • Operation Types: Read (extract text), Write (modify content), Clear.

15. Text Processing

Built-in common text formatting and manipulation tools.

  • Operation Types: Regex Match, Regex Replace, Split/Join, Case Conversion, Substring.

16. Play Sound

  • Types: System Beep, standard system notification sounds (Asterisk, Warning), and specified local audio file paths.

Practical Examples

Example 1: Office Environment Launch

text
Script Name: Office Launch
Action Sequence:
1. [Launch App] WeChat
2. [Delay Wait] 2000ms
3. [Launch App] VS Code
4. [Delay Wait] 2000ms
5. [Open URL] Email
6. [Open URL] Project Kanban

Example 2: Dev Environment Launch

text
Script Name: Start Dev Environment
Action Sequence:
1. [Launch App] Project Folder
2. [Delay Wait] 1000ms
3. [Launch App] VS Code
4. [System Command] Start Database Service
5. [Delay Wait] 2000ms
6. [System Command] Start Backend Service
7. [Open URL] http://localhost:3000

Example 3: File Backup

text
Script Name: Daily Backup
Action Sequence:
1. [File Operation] Copy Work Documents
   Source: D:\Documents\Work
   Target: E:\Backup\Work_Backup
2. [File Operation] Copy Project Code
   Source: D:\Projects
   Target: E:\Backup\Projects_Backup
text
Script Name: Bilibili Scraping
Action Sequence:
1. [Run Code] JavaScript
   Code:
   const axios = require('axios');
   const res = await axios.get('https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1');
   const videos = res.data.data.list.map(v => ({
     Title: v.title,
     Uploader: v.owner.name,
     Views: v.stat.view,
     Link: 'https://www.bilibili.com/video/' + v.bvid
   }));
   
   // Pop up save dialog
   await Mixstart.saveFile(
     JSON.stringify(videos, null, 2),
     'bilibili_hot.json'
   );
   console.log('Fetched', videos.length, 'trending videos');

TIP

This script can be saved and run periodically to track Bilibili trends.

Tips

  • ✅ Add delays after launching apps to ensure they finish loading.
  • ✅ Actions are executed sequentially from top to bottom.
  • ✅ Test a new script once after creating it.
  • ✅ Keep detailed records of the script's purpose and parameters.
  • ✅ Use categories to manage your scripts effectively.
  • ✅ Regularly back up important scripts.

Precautions

  • ⚠️ File deletion operations are irrecoverable; use with caution.
  • ⚠️ System commands require administrator privileges.
  • ⚠️ Consult documentation if you're unfamiliar with a command.
  • ⚠️ Avoid executing commands from unknown sources.