编排补全uTools接口,新增获取选中文件、图片、文字

This commit is contained in:
fofolee
2025-01-10 22:35:19 +08:00
parent bf5a2306d0
commit e7da2d3a26
7 changed files with 284 additions and 0 deletions

View File

@@ -15,11 +15,13 @@ import { screenCommands } from "./screenCommands";
import { audioCommands } from "./audioCommands";
import { imageCommands } from "./imageCommands";
import { windowsCommands } from "./windowsCommands";
import { statusCommands } from "./statusCommands";
let commands = [
fileCommands,
networkCommands,
systemCommands,
statusCommands,
audioCommands,
imageCommands,
notifyCommands,

View File

@@ -0,0 +1,51 @@
export const statusCommands = {
label: "获取状态",
icon: "task",
commands: [
{
value: "utools.readCurrentFolderPath",
label: "获取当前文件管理器路径",
desc: "获取当前文件管理器窗口路径",
icon: "folder",
isAsync: true,
outputVariable: "currentFolderPath",
saveOutput: true,
},
{
value: "utools.readCurrentBrowserUrl",
label: "获取当前浏览器地址",
desc: "获取当前浏览器窗口URL",
icon: "language",
isAsync: true,
outputVariable: "currentBrowserUrl",
saveOutput: true,
},
{
value: "quickcomposer.status.getSelectedText",
label: "获取选中文本",
desc: "获取选中的文本",
icon: "text_fields",
isAsync: true,
outputVariable: "selectedText",
saveOutput: true,
},
{
value: "quickcomposer.status.getSelectedImage",
label: "获取选中的图片",
desc: "获取选中的图片",
icon: "image",
isAsync: true,
outputVariable: "selectedImage",
saveOutput: true,
},
{
value: "quickcomposer.status.getSelectedFiles",
label: "获取选中的文件",
desc: "获取选中的文件",
icon: "file_present",
isAsync: true,
outputVariable: "selectedFiles",
saveOutput: true,
},
],
};

View File

@@ -113,6 +113,100 @@ export const systemCommands = {
icon: "terminal",
isAsync: true,
},
{
value: "utools.getPath",
label: "获取系统路径",
desc: "获取系统路径",
outputVariable: "systemPath",
saveOutput: true,
defaultValue: "home",
config: [
{
label: "路径类型",
component: "ButtonGroup",
options: [
{
label: "用户主目录",
value: "home",
},
{
label: "应用数据目录",
value: "appData",
},
{
label: "用户数据目录",
value: "userData",
},
{
label: "缓存目录",
value: "cache",
},
{
label: "临时目录",
value: "temp",
},
{
label: "桌面",
value: "desktop",
},
{
label: "文档",
value: "documents",
},
{
label: "下载",
value: "downloads",
},
{
label: "音乐",
value: "music",
},
{
label: "图片",
value: "pictures",
},
{
label: "视频",
value: "videos",
},
{
label: "uTools日志目录",
value: "logs",
},
{
label: "uTools程序目录",
value: "exe",
},
{
label: "uTools模块目录",
value: "module",
},
],
},
],
},
{
value: "utools.isMacOS",
label: "判断系统类型",
desc: "判断系统类型",
subCommands: [
{
value: "utools.isMacOS",
label: "是否Mac",
icon: "computer",
},
{
value: "utools.isWindows",
label: "是否Windows",
icon: "computer",
},
{
value: "utools.isLinux",
label: "是否Linux",
icon: "computer",
},
],
},
{
value: "quickcomposer.system.os.arch",
label: "系统信息",

View File

@@ -183,5 +183,19 @@ export const utoolsCommands = {
outputVariable: "windowType",
saveOutput: true,
},
{
value: "utools.getNativeId",
label: "获取本地ID",
desc: "获取本地ID",
outputVariable: "nativeId",
saveOutput: true,
},
{
value: "utools.getAppVersion",
label: "获取uTools版本",
desc: "获取uTools版本",
outputVariable: "appVersion",
saveOutput: true,
},
],
};