Re: AppleScriptObjC oddity
Re: AppleScriptObjC oddity
- Subject: Re: AppleScriptObjC oddity
- From: Chris Page <email@hidden>
- Date: Sun, 12 Jul 2015 21:33:47 -0700
> On Jul 12, 2015, at 8:56 PM, Shane Stanley <email@hidden> wrote:
>
> On 13 Jul 2015, at 12:48 pm, Chris Page <email@hidden> wrote:
>>
>> 1. Since the script doesn't use scripting additions, there's no reason to 'use scripting additions'. One of the goals of "use" is to add more structure and explicitness to the otherwise very dynamic AppleScript language, and part of this is being concise and not "use"ing things unless you actually need them. (I understand if this is an excerpt from a larger script that does use additions, but I thought this was a good opportunity to mention this.)
>
> Although this is correct, there's a counter-argument based on practicality: if you don't include "use scripting additions", and at some stage you develop your script and change your mind, adding one can result in lots of terminology conflicts with method names and parameters you have used...
That's actually a further reason not to use "use scripting additions". In most cases, you shouldn't need scripting additions available everywhere in your script, just where you're actually using them. Instead of importing them globally, use "using terms from scripting additions" to explicitly import them only where you need them, eliminating conflicts. This is in line with the advice of not using scripting additions inside "tell application" blocks.
> ...and tracking them down can be quite painful. It's one of the downsides to interleaved syntax.
Please file bug reports if this is an issue for you. (Shane has.)
--
Chris Page
The other, other AppleScript Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden