vway
V2EX  ›  Node.js

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

  •  
  •   vway · Apr 11, 2019 · 5682 views
    This topic created in 2620 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
        1
    vway  
    OP
       Apr 11, 2019
    窗口句柄例子:
    ```js
    var fpid = robot.findIds("Google")
    console.log("pids... ", fpid)

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