There are many examples where Excel’s scripting differs greatly from ‘pure’ AppleScript, and in ways that overly complicate the process for users. It might make sense from a programming implementation standpoint, but as a user it is highly counter-intuitive. Take, for example:
Why are these not all implemented via a simple single ‘get’ command (which also exists) with an appropriate property and object identifier? More to the point, how is a user supposed to know whether to use regular ‘get’ with an object and property, or this specific command?
For the sake of brevity, I’ll omit listing the 14 ‘set’ commands that should all be implemented via a single ‘set’ with a object/property specifier. I’ll also omit the 21 different “clear…’ commands and the 14 ‘add…’ commands; the 11 ‘copy…’ commands, 11 ‘clear…’ commands; and the 10 different 'save…’ commands.
2: duplicate commands
Pop Quiz: What’s the difference between these four commands:
check spelling
check spelling
check spelling
check spelling
Answer: They are each implemented in different suites (the Microsoft Excel suite, the Drawing Suite, the Table Suite and the Chart Suite). Why? Why not one implementation that passes a target object and takes it from there? They all take the exact same set of optional parameters.
Similar BS… oops, I mean issues exist with the three different ‘print out’ commands (which is somehow different from the ‘print’ command); the two ‘refresh’ commands (which are different from the ‘refresh all’ command); the three ‘activate object’ commands; the three ‘bring to front’ commands (along with corresponding three ’sent to back’); the three ‘clear contents’ commands, the four ‘copy picture’ commands… the list goes on.
In short, the dictionary is a mess. I agree that with time and practice (and practice, and hundreds of dollars in the swear jar, and more practice) you can probably get Excel to do what you want via it’s scripting interface, but to call it a good implementation of AppleScript is an insult to AppleScript.
Andrew
:)
1)
https://developer.apple.com/library/mac/technotes/tn2002/tn2106.html