I was looking at some code by @JMichaelTX, and I saw this:
var kmeApp = Application("com.stairways.keyboardmaestro.engine")
var kmVarNameArr = kmeApp.variables.name()
I can’t find this in KME’s dictionary. I’m sure I just don’t know what I’m doing. Can someone tell me how, if I hadn’t seen this in someone’s code, I’d know it’s available?
And how, if possible, What’s the AS syntax for this?
The application contains a variables collection - the convention is that the collections are lowercase with an affixed s, and the class name of an individual element of a collection is singular.
(the class constructor function is singular with an initial uppercase)
I don’t see this information in Script Debugger’s version of Dictionary.
That appears to be the only place where “variables” (plural) are mentioned. There’s things like “getvariable” and “executing”. Why wouldn’t “variables” be mentioned somewhere else?
Well, Script Debugger doesn't read the .sdef in JS format, only in AS format, so its only an indirect guide to JS usage, but take a look, for example, in the Script Debugger Explorer panel:
Never quite sure what this business with urgent capital-shouting is really about,
but I have to say that this is a pontifical pronouncement which slightly puzzles me.
I somehow seem to have written tens of thousands of lines of AppleScript without ever once typing the word every, despite making rather intensive use of the batch-reading and batch-setting of collections.
Taste and usage varies, not sure that there’s an urgent need to police it.
(I personally happen to be a bit unconvinced by the alleged clarity of these elements of aspirant ‘Englishness’ in AS, especially where they simply make it more verbose, and split linked morphemes with white space).