4 ms·
I have never been able to build a mental model of Applescript sufficient to allow me to work with it. For example, when trying to script the Terminal applicatio
by tzs 15y ago
I have never been able to build a mental model of Applescript sufficient to allow me to work with it. For example, when trying to script the Terminal application, this works:
set current settings of first tab of first window to first settings set
this does not:
set first_set to first settings set
set current settings of first tab of first window to first_set
but this does:
set first_set to a reference to first settings set
set current settings of first tab of first window to first_set
Or suppose you have a tab ("get first tab of first window"). You want the container of that, so you try to apply the obvious "container of" to the tab. Nope.
Nearly every attempt I've made to use Applescript has ended in frustration when something that every book I've found tells me should work nearly everywhere does not work in the specific application I'm trying to script, and either I can't figure out a work around, or I eventually come up with something I don't understand like my first example above of referencing terminal settings.
- js2 15y agoTry reading "AppleScript: The Definitive Guide". It's the only Applescript book I've read that's worth anything and clarified a lot for me.