4 ms·
I suspect GP means AppleEvents rather than AppleScript. AppleEvents are a high level event framework, it lets you tell applications things like 'select the 5th
by sitharus 10y ago
I 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.