V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
vway
V2EX  ›  Node.js

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

  •  
  •   vway · 2019-04-11 07:48:40 +08:00 · 4724 次点击
    这是一个创建于 1835 天前的主题,其中的信息可能已经有所发展或是发生改变。

    通过 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 条回复    2019-04-24 21:40:22 +08:00
    vway
        1
    vway  
    OP
       2019-04-11 08:02:46 +08:00
    窗口句柄例子:
    ```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  
       2019-04-11 11:46:56 +08:00
    没搞明白它能用来干什么。。。做按键精灵一类的事情?
    Abbeyok
        3
    Abbeyok  
       2019-04-11 12:03:31 +08:00 via Android
    关注一下
    vway
        4
    vway  
    OP
       2019-04-11 22:57:35 +08:00
    @guyeu 可以做类似的事情, 跨平台的
    vway
        5
    vway  
    OP
       2019-04-11 22:57:46 +08:00
    @Abbeyok 感谢关注
    chenhui7373
        6
    chenhui7373  
       2019-04-24 21:40:22 +08:00
    和 aardio 比有啥优势?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   998 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 72ms · UTC 22:43 · PVG 06:43 · LAX 15:43 · JFK 18:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.