Re: InDesign CS6
Re: InDesign CS6
- Subject: Re: InDesign CS6
- From: has <email@hidden>
- Date: Thu, 15 Jan 2015 12:54:14 +0000
Shane Stanley wrote:
> On 15 Jan 2015, at 11:21 am, Stockly, Ed <email@hidden> wrote:
>
>> Any idea why this very simple script won¹t compile in an InDesign tell
>> block?
>>
>> tell application "Adobe InDesign CS6"
>> set myHello to myHello as text
>> end tell
>> -- Expected end of line but found application constant or consideration.
>
> InDesign has redefined the text class. The workaround is to use "as
string" instead.
Nope. While ID's dictionary defines a 'text' keyword, it defines it as a
type symbol with the same AE code ('ctxt') as AS's own 'text' keyword,
so won't conflict with that. (e.g. The same coercion works just fine in
a 'tell app "TextEdit"...end tell' block.)
The conflict is with the 'as text' keyword which ID defines as an
enumerator symbol with AE code 'ebct' (used by 'bullet export option'
properties).
AS looks for the longest match when determining the beginning and end of
a keyword token, and application-defined terminology takes precedence
over AS-defined terminology, so 'as text' is matched as a single
<enumerator-symbol> token rather than separate <binary-operator> and
<type-symbol> tokens. Thus 'myHello as text' is tokenized as
'<identifier> <enumerator-symbol>' instead of '<identifier>
<binary-operator> <type-symbol>', which the parser then rightly rejects
as invalid AS syntax with one of its characteristically unhelpful error
descriptions.
Just one more example of why injecting arbitrary keywords into a
language is a Bad Idea. (And let's not even mention the "wisdom" of
using white space as both token characters AND token separators.)
O AppleScript, y u hate us so?
has
_______________________________________________
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