3 ms·
I tried using AppleScript a couple of times. One of the worst user experiences of my life. Zero documentation for the syntax and semantics of the language, almo
by EdiX 10y ago
I tried using AppleScript a couple of times. One of the worst user experiences of my life. Zero documentation for the syntax and semantics of the language, almost no documentation for the library part, the documentation that existed was 7 years out of date (I was on leopard, the documentation still referenced OS 8) and even after those hurdles I was handcuffed to the sparse and poorly designed API that OS X programs had, that was put in as an afterthought.
Calling that a "solution"...
- sitharus 10y agoI suspect GP means AppleEvents rather than AppleScript. AppleEvents are a high level event framework, it lets you tell applications things like 'select the 5th word of the 2nd paragraph', or 'import all mp3s from /Volumes/USB'. AppleScript tries to allow you to use those exact phrases and creates an uncanny valley language. Automator and other automating applications use AppleEvents to do their magic. Cocoa has AppleEvents built in for the basics, but support has been spotty beyond that so a lot of people are turning to the accessibility framework.
- thomasahle 10y agoTo script a UI application you also need the developers to stop moving things around. I suspect this would be hard, since they are not used to it mattering, if they swap the order of two input fields or such. In the text based world, there is much more aversion to changing the flags.
- blakeyrat 10y agoIf you use AppleEvents correctly, moving things around wouldn't matter, because the scripting interface is completely divorced from the GUI displayed on screen. AppleEvents are things like: "File Open with this path", "Print page 4 of file", "Save As to this path". If someone creates AppleEvents like, "Click button 4 on dialog 2", then they're doing it very wrong.
- Something1234 10y agoWhat do you mean by "uncanny valley language?" Is it too close to natural language, but not close enough or what?
- sitharus 10y agoYes, exactly that. For example: tell application "Finder" to duplicate (every item in folder "Documents" of home whose modification date comes after (current date) - 7 * days) to folder "Documents" of disk "Backups" with replacing It's almost, but not quite, English. It'll trip you up when writing it.
- coldtea 10y agoIt was still a solution, covering all aspects of the issue, and people have done great things with it. But you conflate the solution with the particular implementation. It could be whatever else language instead of AppleScript, e.g. Python or Javascript -- it's the idea that matters.
- blakeyrat 10y agoI switched to Windows, so I honestly have no idea, but I get the impression that AppleScript/AppleEvents has been pretty much utterly ignored by OS X except for a small amount of backwards-compatibility lip-service. I stopped using Mac OS when OS X dropped Classic compatibility.