Re: type string vs. text
Re: type string vs. text
- Subject: Re: type string vs. text
- From: Shane Stanley <email@hidden>
- Date: Tue, 28 Jun 2016 09:33:40 +1000
On 28 Jun 2016, at 8:52 AM, Mitchell L Model <email@hidden> wrote:
>
> What I don’t get is how strings could be “in the language”, however crudely, but be eliminated by the use of scripting additions.
Let's back up a little. In the beginning, text and string were synonyms for the class. When Unicode was introduced, along with Unicode text, they diverged for a while, but when AppleScript became Unicode-only, they again became synonyms for the same class.
But there are a few potential problems. Sometimes applications define their own string class, and so it behaves differently within their tell blocks. In the case of at least one application (InDesign) there's a bug where the code for text has been used for something else, so you need to use string.
And there's at least one case of an old scripting addition that, from memory, does a coercion involving string, and this causes problems in scripts that include use statements, because with use statements the compiler behaves a little bit differently. I think it's one of the older XML libraries.
(This is another reason why scripting additions can be a pain: they can introduce invisible coercions.)
Anyway, for this particular problem the answer is to not go hoarding old scripting additions. If you don't use them, throw them out, or at least move them somewhere else. But if you can't bring yourself to do that, use text (outside InDesign).
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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