3 ms·
I think a nice solution for what the author is looking for in a GUI, namely the ability to write a script that controls them, is achieved today by something lik
by saagarjha 8y ago
I think a nice solution for what the author is looking for in a GUI, namely the ability to write a script that controls them, is achieved today by something like AppleScript, which pretty much does exactly that: you can write little scripts that allow you to have basically full control of the application's UI (and in some cases, the parts not visible). So you really have the best of both worlds: a nice, pretty, and simple GUI interface that most people can use, and a scriptable backing that can be queried and manipulated in useful ways for purposes such as automation.
Less related: This is from 1998, I believe, but I guess the general date is obvious from the title itself.
- afraca 8y agoIf I understand it correctly it's actually from 1992. As for Applescript: how precise can we get with it actually? I think when applications use native toolkits Applescript can figure quite much out on its own, but with custom elements (an Electron application), is this still the case?
- saagarjha 8y ago> If I understand it correctly it's actually from 1992. I think you're right–the 1998 is the date it was forwarded, or something like that. > As for Applescript: how precise can we get with it actually? I think when applications use native toolkits Applescript can figure quite much out on its own, but with custom elements (an Electron application), is this still the case? AppleScript can do everything you, the GUI user can do, at least for native applications. There is an API for adding functionality that doesn't map cleanly to a user interface through scripting dictionaries, so from a certain perspective it can actually do more. With regards to Electron, all bets are off: the application only has this functionality if it writes it itself. This is one of the reasons I generally have a distaste for Electron; it really breaks a lot of nice things that the system provides that are nonobvious if you don't use them but really hurt if you do.
- danenania 8y agoWhile they might not work well with Applescript, Electron apps can be scripted with a tool like https://electronjs.org/spectron https://electronjs.org/spectron.
- peterburkimsher 8y agoAppleScript is great, and I taught it to myself when I was 13. I still use it often. But I'm wanting to move to Linux. So far I haven't found a real replacement. If anybody's interested in working on that together, please get in touch!
- dmortin 8y agoNot everyone uses Apple, and not all GUIs use the system widgets. The latter are usually opaque to such scripting tools, at most you can script clicking to a certain position in a window which can break the script if buttons are moved.
- saagarjha 8y agoI'm not saying that everyone has access to this; my goal was to merely bring up an example of a system that already exists and works reasonably well. I'd really love for every application and system to adopt something like this, because, like you've mentioned, other solutions are generally very brittle.