vway
V2EX  ›  Node.js

Robotn, 使用 robotgo 绑定 JavaScript 和 Python 的跨平台桌面自动化系统

  •  
  •   vway · Apr 11, 2019 · 6108 views
    This topic created in 2763 days ago, the information mentioned may be changed or developed.

    通过 Robotgo 绑定 JavaScript 和 python 等编程语言,实现 Golang 跨平台、跨语言桌面自动化, 控制鼠标、键盘、位图、屏幕、窗口句柄以及全局事件监听。

    项目地址: https://github.com/vcaesar/robotn

    示例:

    var robot = require('robotn');
    
    robot.scroll(10, 10);
    robot.mouseClick("left", true);
    robot.moveSmooth(100, 200, 1.0, 100.0);
    
    
    console.log("--- Please press ctrl + shift + q ---")
    var ok = robotgo.AddEvents("q", "ctrl", "shift")
    if ok {
        console.log(("add events...")
    }
    

    python

    import robot
    
    robot.scroll(10, 10)
    robot.mouseClick("left", true)
    robot.moveSmooth(100, 200, 1.0, 100.0)
    
    6 replies  •  2019-04-24 21:40:22 +08:00
    vway
    vway
    OP
    Apr 11, 2019
    1
    窗口句柄例子:
    ```js
    var fpid = robot.findIds("Google")
    console.log("pids... ", fpid)

    if (fpid.length > 0) {
    robot.activePID(fpid[0])
    robot.kill(fpid[0])
    }
    ```
    guyeu
    guyeu
    Apr 11, 2019
    2
    没搞明白它能用来干什么。。。做按键精灵一类的事情?
    Ct5T66PVR1bW7b2z
    Ct5T66PVR1bW7b2z
    Apr 11, 2019 via Android
    3
    关注一下
    vway
    vway
    OP
    Apr 11, 2019
    4
    @guyeu 可以做类似的事情, 跨平台的
    vway
    vway
    OP
    Apr 11, 2019
    5
    @Abbeyok 感谢关注
    chenhui7373
    chenhui7373
    Apr 24, 2019
    6
    和 aardio 比有啥优势?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5234 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 03:25 · PVG 11:25 · LAX 19:25 · JFK 22:25
    ♥ Do have faith in what you're doing.