桌面自动化
预览鼠标、键盘与已打开窗口的操控
6 个类别,共 116 个节点
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 支持等级
- 第 2 级(拟定)
- 所属包
- 桌面自动化
桌面自动化
控制鼠标和键盘,与已打开的窗口交互,并处理文件和正在运行的进程。使用这些工具在其他桌面应用程序中自动执行任务。
宏自动化
激活窗口Brings the window whose title contains this text, ignoring case, to the front and gives it the keyboard - how a macro switches to another program before sending it keys.点击鼠标Presses and releases a mouse button where the pointer already is.在指定位置点击鼠标Moves the pointer somewhere and clicks there.关闭窗口Asks a window to close, as its title bar button does.指挥进程的窗口Applies one command to every window of a named process.双击鼠标Presses and releases a button twice where the pointer already is.拖动Presses a button at one point, glides to another, and releases.沿路径拖动Presses a button at the first point, glides through every remaining point in order, and releases at the last.沿多条路径拖动Draws a whole pen path: one drag per pen-down..pen-up mark, in order, with the pen lifted between them.查找窗口The first window whose title contains this text, or DesktopWindow.None.按进程查找窗口Every window whose owning process has this name, ignoring case and an .exe suffix.按标题查找窗口Every window whose title contains this text, ignoring case.聚焦进程Brings a named process's first window to the front.聚焦窗口Brings a window to the front and gives it the keyboard.能否读取按键状态Whether this machine can be asked what the keyboard is doing, as opposed to only told.是否支持False where nothing here can emulate input on this machine; every call is then a no-op.平台名称A short name for a status line: "Windows", "X11", "Quartz", "none".支持情况How far the backend in force is to be trusted.获取光标位置Where the pointer is now.获取指定位置的显示器Which monitor a coordinate is on, or the primary one where it is on none of them.获取显示器Every monitor, with its place on the virtual desktop and its scale.获取前台窗口The window with focus, or DesktopWindow.None where nothing has it.获取自身进程名称This process's own name, so a macro can recognise - and avoid acting on - the windows of the program running it.获取有窗口的进程The distinct names of every process that owns a window, for a caller offering a list to choose from.获取虚拟桌面边界The rectangle every coordinate in this class lives in: the union of every monitor.获取窗口边界Where the first window of a named process is, as four numbers, and whether it was found at all.获取窗口Every top-level window that is on screen and has a title, front-most first where the platform has an order.获取光标下的窗口The front-most window whose bounds contain the pointer, or DesktopWindow.None.按键是否按下Whether a key is physically down right now, whoever has focus.最大化前台窗口Maximises the window that currently has focus.最大化进程窗口Maximises every window of a named process.最大化窗口Fills the window's monitor with it.最小化前台窗口Iconifies the window that currently has focus.最小化进程窗口Iconifies every window of a named process.最小化窗口Iconifies a window.移动光标Moves the pointer by a delta from wherever it is.平滑移动光标Moves the pointer to an absolute coordinate over time, accelerating and decelerating.按键Presses and releases a key, optionally holding modifiers while it is pressed.按组合键Presses a chord given as keys: every key but the last is held, the last is pressed, and the held ones are released in reverse.还原进程窗口Brings back every minimised window of a named process, each as it was before it was minimised, and leaves its other windows as they are.还原窗口Puts a minimised or maximised window back to its previous size.滚动到位置Scrolls vertically.水平滚动Scrolls horizontally.发送文本Types text into whatever has focus, as characters rather than key positions.设置光标位置Puts the pointer at an absolute virtual-desktop coordinate, immediately.设置按键状态Holds a key down, or lets it up, without the other half.设置鼠标状态Presses or releases a mouse button without releasing it again.尝试启用按显示器 DPI 感知Asks Windows to treat this process as per-monitor DPI aware, so the coordinates here are real pixels.尝试按下指定名称的键Presses a key named as text, including a chord written as one string: "Enter", "esc", "ctrl+c".尝试按下指定名称的多个键Presses a chord named as separate strings, as ["ctrl", "shift", "n"].等待Waits, in milliseconds.等待,除非按下某键Waits, unless a key goes down first - in which case it stops waiting there and says so.
屏幕矩形
屏幕矩形A rectangle on the virtual desktop.包含Half-open containment: the right and bottom edges are outside.分解相等下边One past the bottommost pixel.中心The pixel in the middle, which is where a window command aims a click.设置高度是否为空True where this rectangle encloses no pixels at all.右边One past the rightmost pixel.设置宽度设置 X设置 Y获取哈希码设置高度设置宽度设置 X设置 Y转为文本Reads as a rectangle rather than as a record's field list.并集The smallest rectangle holding both.空矩形Nothing: what a backend that cannot answer the question reports.相等运算不等运算
桌面窗口
桌面窗口A window somewhere on the desktop, and which process owns it.分解相等边界Where it sits, in virtual-desktop coordinates.显示状态Minimised, maximised or ordinary.是否存在False for DesktopWindow.None.句柄The platform's identifier: an HWND on Windows, an X11 window id, a CGWindowID.进程 IDThe owning process, or 0 where unknown.进程名称The owning process's name without extension, or empty where unknown.标题The window's title bar text.获取哈希码转为文本Reads as a window rather than as a record's field list, for a log line or a status bar.无窗口No window: what "nothing is in front" and "nothing matched" both report.相等运算不等运算
显示器信息
显示器信息One monitor: where it sits on the virtual desktop, and at what scale.分解相等边界The whole monitor, in virtual-desktop pixels.每英寸点数The monitor's effective DPI, 96 meaning unscaled.是否为主显示器The one whose top-left corner is the origin.名称The platform's name for the device, for a caller that wants to show a list.缩放比例96 DPI is 1.0; a monitor at 150% reports 1.5.工作区域What is left after the taskbar or dock.获取哈希码转为文本相等运算不等运算