3 ms·
Gah. I thought this was a library to do Automation in Windows using Javascript. That would have been a dream compared to what the Windows ecosystem currently ha
by Nemcue 11y ago
Gah. I thought this was a library to do Automation in Windows using Javascript. That would have been a dream compared to what the Windows ecosystem currently has.
Autohotkey et.al are impressive in terms of functionality, but holy hell is the syntax and structure awful.
- Aleman360 11y agohttp://uiautomation.codeplex.com/ http://uiautomation.codeplex.com/ Let's you do UI automation in PowerShell. This example starts calc.exe and clicks buttons 1, 2, 3: Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name [1-3] | Invoke-UIAButtonClick;
- nextw33k 11y agoMy problem with PowerShell is that its Yet Another Syntax To Learn (YASTL). If a JavaScript runtime like nodejs had access to the same interfaces as PowerShell or to COM I'd be over the moon. It would be very powerful, you'd effectively be opening up windows shell programming (OS scripting) to tens of millions of developers rather than the 1% that take the time to learn PowerShell.
- Nemcue 11y agoYes! You're so right. I've actually experienced this first hand. There's a small but prolific community on OSX who do this for Window Management and Automation; see https://github.com/jasonm23/phoenix https://github.com/jasonm23/phoenix and http://hammerspoon.org http://hammerspoon.org They're great to work with, and it's easy to build your own abstractions on top since they actually have a real language that you can work with. Imagine this for instance: Windows.find(window => window.title == "Sublime Text") .moveTo(Screen.find(screen => screen.name.contains("Dell")) It's so bizarre to me this isn't a thing in Windows. It's a super good thing to have.
- chadzawistowski 11y agoAutohotkey's syntax is expedient for keybindings, but I agree it's pretty awful for nontrivial automation. I find AutoIt3 better for complex automation, but it still lacks features from general-purpose languages. Your best bet for Windows automation might be AutoItX, a DLL/COM control that can be used from C++, C#, or other managed languages such as F#.