├── .gitignore ├── LICENSE ├── README.md ├── resource └── images │ └── uTools_developer_match_windows.png ├── utools-helloworld-example ├── index.html ├── logo.png ├── plugin.json ├── preload.js └── style.css ├── utools-match-files-example ├── README.md ├── index.html ├── logo.png ├── plugin.json └── preload.js ├── utools-match-img-example ├── README.md ├── index.html ├── logo.png ├── plugin.json └── preload.js ├── utools-match-text-example ├── README.md ├── index.html ├── logo.png ├── plugin.json └── preload.js ├── utools-match-window-example ├── README.md ├── index.html ├── logo.png ├── plugin.json └── preload.js ├── utools-template-doc-example ├── READEME.md ├── doc │ └── test.html ├── logo.png ├── plugin.json └── preload.js ├── utools-template-list-example ├── READEME.md ├── logo.png ├── plugin.json └── preload.js └── utools-template-noneui-example ├── READEME.md ├── logo.png ├── plugin.json └── preload.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | # Package files 27 | *.yarnclean 28 | yarn.lock 29 | package-lock.json 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 uTools-Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #utools 开发者示例 2 | 3 | -------------------------------------------------------------------------------- /resource/images/uTools_developer_match_windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/resource/images/uTools_developer_match_windows.png -------------------------------------------------------------------------------- /utools-helloworld-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |

hello world!

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /utools-helloworld-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-helloworld-example/logo.png -------------------------------------------------------------------------------- /utools-helloworld-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-helloworld", 3 | "version": "1.0.0", 4 | "pluginName": "demo-helloworld", 5 | "description": "helloworld示例插件", 6 | "main": "index.html", 7 | "logo": "logo.png", 8 | "preload": "preload.js", 9 | "features": [ 10 | { 11 | "code": "demo-helloworld", 12 | "explain": "helloworld示例插件", 13 | "cmds": [ 14 | "hello" 15 | ] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /utools-helloworld-example/preload.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utools-helloworld-example/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | padding: 0; 4 | margin: 0; 5 | } 6 | 7 | html, 8 | body { 9 | max-width: 100vw; 10 | overflow-x: hidden; 11 | } 12 | 13 | .container { 14 | width: 100%; 15 | height: 100vh; 16 | display: flex; 17 | justify-content: center; 18 | align-items: center; 19 | } 20 | -------------------------------------------------------------------------------- /utools-match-files-example/README.md: -------------------------------------------------------------------------------- 1 | # uTools智能匹配示例 - 文件匹配 2 | 3 | 4 | ## 运行示例插件 5 | 1. 打开uTools开发工具 6 | 2. 新建项目 7 | 3. 选择utools-match-files-example下的plugin.json 8 | 4. 运行 9 | 5. 复制文件或文件夹后呼出uTools即可看到智能匹配到了该插件 -------------------------------------------------------------------------------- /utools-match-files-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 48 | 49 | 50 | 51 |
52 | 53 | 54 |
55 | 56 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /utools-match-files-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-match-files-example/logo.png -------------------------------------------------------------------------------- /utools-match-files-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo_match_files", 3 | "version": "1.0.0", 4 | "pluginName": "智能匹配文件示例", 5 | "description": "智能匹配文件示例插件", 6 | "main": "index.html", 7 | "logo": "logo.png", 8 | "preload": "preload.js", 9 | "features": [ 10 | { 11 | "code": "demo_match_files", 12 | "explain": "智能匹配文件示例", 13 | "cmds": [ 14 | "match_files", 15 | { 16 | "type": "files", 17 | "label": "智能匹配文件", 18 | "minLength": 1, 19 | "maxLength": 10 20 | } 21 | ] 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /utools-match-files-example/preload.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utools-match-img-example/README.md: -------------------------------------------------------------------------------- 1 | # uTools智能匹配示例 - 图片匹配 2 | 3 | 4 | ## 运行示例插件 5 | ``` 6 | 1. 打开[uTools] - [插件应用市场] 7 | 2. 安装并打开[uTools 开发者工具] 8 | 3. 新建项目 9 | 4. 选择utools-match-img-example下的plugin.json 10 | 5. 运行 11 | 6. 屏幕截图后呼出uTools观察可看到智能匹配到了该插件 12 | ``` -------------------------------------------------------------------------------- /utools-match-img-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 33 | 34 | 35 | 36 |
37 | 38 | 39 |
40 | 41 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /utools-match-img-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-match-img-example/logo.png -------------------------------------------------------------------------------- /utools-match-img-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo_match_img", 3 | "version": "1.0.0", 4 | "pluginName": "智能匹配图片示例", 5 | "description": "智能匹配图片示例插件", 6 | "main": "index.html", 7 | "logo": "logo.png", 8 | "preload": "preload.js", 9 | "features": [ 10 | { 11 | "code": "demo_match_img", 12 | "explain": "智能匹配图片示例", 13 | "cmds": [ 14 | "match_img", 15 | { 16 | "type": "img", 17 | "label": "智能匹配图片" 18 | } 19 | ] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /utools-match-img-example/preload.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utools-match-text-example/README.md: -------------------------------------------------------------------------------- 1 | # uTools智能匹配示例 - 文本正则匹配 2 | 3 | 4 | ## 运行示例插件 5 | 1. 打开uTools开发工具 6 | 2. 新建项目 7 | 3. 选择utools-match-text-example下的plugin.json 8 | 4. 运行 9 | 5. 在uTools主输入框输入网址、手机号、身份证号即可观察匹配到该插件 -------------------------------------------------------------------------------- /utools-match-text-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 28 | 29 | 30 | 31 |
32 | 33 |

34 |
35 | 36 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /utools-match-text-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-match-text-example/logo.png -------------------------------------------------------------------------------- /utools-match-text-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo_match_text", 3 | "version": "1.0.0", 4 | "pluginName": "智能匹配文本示例", 5 | "description": "智能匹配文本示例插件", 6 | "main": "index.html", 7 | "logo": "logo.png", 8 | "preload": "preload.js", 9 | "features": [ 10 | { 11 | "code": "demo_match_text", 12 | "explain": "智能匹配文本示例", 13 | "cmds": [ 14 | "match_text", 15 | { 16 | "type": "regex", 17 | "label": "网址匹配", 18 | "match": "/^(?:(http|https|ftp):\/\/)?((?:[\\w-]+\\.)+[a-z0-9]+)((?:\/[^\/?#]*)+)?(\\?[^#]+)?(#.+)?$/i" 19 | }, 20 | { 21 | "type": "regex", 22 | "label": "身份证号匹配", 23 | "match": "/^[1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$/" 24 | }, 25 | { 26 | "type": "regex", 27 | "label": "手机号正则匹配", 28 | "match": "/^1[3456789]\\d{9}$/" 29 | } 30 | ] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /utools-match-text-example/preload.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utools-match-window-example/README.md: -------------------------------------------------------------------------------- 1 | # uTools智能匹配示例 - 窗口匹配 2 | 3 | 4 | ## 运行示例插件 5 | ``` 6 | 1. 打开[uTools] - [插件应用市场] 7 | 2. 安装并打开[uTools 开发者工具] 8 | 3. 新建项目 9 | 4. 选择utools-match-windows-example下的plugin.json 10 | 5. 运行 11 | 6. windows下打开[文件夹, 微信, 飞书, vsCode, 网易云音乐, Edg浏览器]任一窗口再呼出uTools观察第二栏匹配上了该插件 12 | ``` 13 | 14 | ## 窗口智能匹配界面 15 | ![match_windows.png](../resource/images/uTools_developer_match_windows.png) 16 | 17 | ## 添加更多的窗口匹配 18 | 1. 打开要匹配的窗口, 比如vscode 19 | 2. 打开uTools, 检索窗口信息, 打开窗口信息插件 20 | 3. 复制应用的值例如:Code.exe 21 | 4. plugin.json添加应用 22 | ```json 23 | "features": [ 24 | { 25 | "code": "xxx", 26 | "explain": "xxx", 27 | "cmds": [ 28 | "xxx", 29 | { 30 | "match": { 31 | "app": [ 32 | // 添加到这 33 | "Code.exe" 34 | ] 35 | } 36 | } 37 | ] 38 | } 39 | ] 40 | ``` -------------------------------------------------------------------------------- /utools-match-window-example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 29 | 30 | 31 | 32 |
33 | 34 |

35 |   
36 | 37 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /utools-match-window-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-match-window-example/logo.png -------------------------------------------------------------------------------- /utools-match-window-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo_match_windows", 3 | "version": "1.0.0", 4 | "pluginName": "智能匹配活动窗口示例", 5 | "description": "智能匹配活动窗口示例插件", 6 | "main": "index.html", 7 | "logo": "logo.png", 8 | "preload": "preload.js", 9 | "features": [ 10 | { 11 | "code": "demo_match_windows", 12 | "explain": "智能匹配活动窗口示例", 13 | "cmds": [ 14 | "match_windows", 15 | { 16 | "type": "window", 17 | "label": "置顶窗口", 18 | "match": { 19 | "app": [ 20 | "explorer.exe", 21 | "Feishu.exe", 22 | "WeChat.exe", 23 | "cloudmusic.exe", 24 | "msedge.exe", 25 | "Code.exe" 26 | ] 27 | } 28 | } 29 | ] 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /utools-match-window-example/preload.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utools-template-doc-example/READEME.md: -------------------------------------------------------------------------------- 1 | # uTools模板插件应用 - 文档模式 2 | 3 | ## 运行示例插件 4 | 1. 打开uTools开发工具 5 | 2. 新建项目 6 | 3. 选择utools-template-doc-example下的plugin.json 7 | 4. 运行 -------------------------------------------------------------------------------- /utools-template-doc-example/doc/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doc content 6 | 7 | 8 |

Doc content

9 | 10 | -------------------------------------------------------------------------------- /utools-template-doc-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-template-doc-example/logo.png -------------------------------------------------------------------------------- /utools-template-doc-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-doc", 3 | "version": "1.0.0", 4 | "pluginName": "demo-doc", 5 | "description": "文档模式示例插件", 6 | "logo": "logo.png", 7 | "preload": "preload.js", 8 | "features": [ 9 | { 10 | "code": "demo-doc", 11 | "explain": "文档模式示例插件", 12 | "cmds": [ 13 | "doc" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /utools-template-doc-example/preload.js: -------------------------------------------------------------------------------- 1 | window.exports = { 2 | "demo-doc": { 3 | mode: "doc", 4 | args: { 5 | // 索引集合 6 | // indexes: require('./indexes.json') 7 | indexes:[ 8 | { 9 | t: '这是标题', 10 | d: '这是描述', 11 | p: 'doc/test.html' 12 | } 13 | ], 14 | // 子输入框为空时的占位符,默认为字符串"搜索" 15 | placeholder: "搜索" 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /utools-template-list-example/READEME.md: -------------------------------------------------------------------------------- 1 | # uTools模板插件应用 - 列表模式 2 | 3 | ## 运行示例插件 4 | 1. 打开uTools开发工具 5 | 2. 新建项目 6 | 3. 选择utools-template-list-example下的plugin.json 7 | 4. 运行 -------------------------------------------------------------------------------- /utools-template-list-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-template-list-example/logo.png -------------------------------------------------------------------------------- /utools-template-list-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-list", 3 | "version": "1.0.0", 4 | "pluginName": "demo-list", 5 | "description": "列表模式示例插件", 6 | "logo": "logo.png", 7 | "preload": "preload.js", 8 | "features": [ 9 | { 10 | "code": "demo-list", 11 | "explain": "列表模式示例插件", 12 | "cmds": [ 13 | "list" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /utools-template-list-example/preload.js: -------------------------------------------------------------------------------- 1 | window.exports = { 2 | "demo-list": { 3 | mode: "list", 4 | args: { 5 | // 进入插件应用时调用(可选) 6 | enter: (action, callbackSetList) => { 7 | // 如果进入插件应用就要显示列表数据 8 | callbackSetList([ 9 | { 10 | title: "这是标题", 11 | description: "这是描述", 12 | icon: "", // 图标(可选), 13 | url: "https://yuanliao.info", 14 | }, 15 | ]) 16 | }, 17 | // 子输入框内容变化时被调用 可选 (未设置则无搜索) 18 | search: (action, searchWord, callbackSetList) => { 19 | // 获取一些数据 20 | // 执行 callbackSetList 显示出来 21 | callbackSetList([ 22 | { 23 | title: "这是标题", 24 | description: "这是描述", 25 | icon: "", // 图标 26 | url: "https://yuanliao.info", 27 | }, 28 | ]) 29 | }, 30 | // 用户选择列表中某个条目时被调用 31 | select: (action, itemData, callbackSetList) => { 32 | window.utools.hideMainWindow() 33 | const url = itemData.url 34 | require('electron').shell.openExternal(url) 35 | window.utools.outPlugin() 36 | }, 37 | // 子输入框为空时的占位符,默认为字符串"搜索" 38 | placeholder: "搜索", 39 | }, 40 | }, 41 | } 42 | -------------------------------------------------------------------------------- /utools-template-noneui-example/READEME.md: -------------------------------------------------------------------------------- 1 | # uTools模板插件应用 - 无UI模式 2 | 3 | ## 运行示例插件 4 | 1. 打开uTools开发工具 5 | 2. 新建项目 6 | 3. 选择utools-template-noneui-example下的plugin.json 7 | 4. 运行 8 | 5. 在uTools主输入框输入网址可观测匹配到该插件,点击插件后将打开浏览器跳转到输入的网址 -------------------------------------------------------------------------------- /utools-template-noneui-example/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uTools-Labs/utools-tutorials/d556a52743b172c9a2a0f6ade9bbc9b7d0f663b9/utools-template-noneui-example/logo.png -------------------------------------------------------------------------------- /utools-template-noneui-example/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-none-ui", 3 | "version": "1.0.0", 4 | "pluginName": "demo-none-ui", 5 | "description": "无UI模式示例插件", 6 | "logo": "logo.png", 7 | "preload": "preload.js", 8 | "features": [ 9 | { 10 | "code": "demo-none-ui", 11 | "explain": "无UI模式示例插件", 12 | "cmds": [ 13 | "noneui", 14 | { 15 | "type": "regex", 16 | "label": "打开网址", 17 | "match": "/^(?:(http|https|ftp):\/\/)?((?:[\\w-]+\\.)+[a-z0-9]+)((?:\/[^\/?#]*)+)?(\\?[^#]+)?(#.+)?$/i" 18 | } 19 | ] 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /utools-template-noneui-example/preload.js: -------------------------------------------------------------------------------- 1 | window.exports = { 2 | "demo-none-ui": { 3 | mode: "none", 4 | args: { 5 | enter: (action) => { 6 | window.utools.hideMainWindow() 7 | const url = action.payload 8 | if (!url) return 9 | require('electron').shell.openExternal(url) 10 | window.utools.outPlugin() 11 | }, 12 | } 13 | } 14 | } --------------------------------------------------------------------------------