Re: Illustrator scripting
Re: Illustrator scripting
- Subject: Re: Illustrator scripting
- From: Jean-Christophe Helary <email@hidden>
- Date: Sun, 22 Jan 2017 10:40:17 +0900
Shane,
Thank you for the reply.
The problematic script is the following:
===================================
var idoc = app.activeDocument;
var sel = idoc.selection;
for (i=0; i<sel.length; i++)
{
var itext = sel[i];
if (itext.typename=="TextFrame") {
var idocvar = idoc.variables.add();
idocvar.kind = VariableKind.TEXTUAL;
itext.contentVariable = idocvar;
}
}
===================================
It is pretty trivial, but it makes Illustrator crash when the number of selected objects is too important (even when I only select text objects).
I'm thinking of adapting it to Applescript so see if there is an improvement.
Jean-Christophe
> On Jan 21, 2017, at 20:40, Shane Stanley <email@hidden> wrote:
>
> On 21 Jan 2017, at 8:12 pm, Jean-Christophe Helary <email@hidden> wrote:
>>
>> I've never worked with Illustrator so I'm wondering if there are good ressources around (I have the CC 2014 reference from Adobe).
>
> There was a book on it, by Ethan Wilde, although it would be long out of print. But scripting it is pretty straight forward -- some of the newer features aren't accessible, but it has a well designed object model. (As you might expect -- it started life as a third-party plug-in written by Mark Alldritt.)
>
> About the main thing to understand is the difference between addressing page items at the document level versus at the later level.
>
>> Also, I'm worried about this performance issue where the script makes Illustrator crash because the actual number that triggers the crash is actually not that big (we're not talking about thousands of text boxes, more lake a hundred or so), so I'm wondering if there is not a glitch in the script itself.
>
> That sounds odd. Things certainly slow down when you address objects at the document level in a complex document, but I've done it with documents containing thousands of items.
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
>
>
>
> _______________________________________________
> 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
_______________________________________________
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