Refresh values from Illustrator
Hello, hello ![]()
I'm learning scripting for Illustrator and Script UI and I have 2 problems but I will separate this 2 problems in 2 differents posts.
It's first problem.
I use ExtendScript Toolkit to test my scipt in Illustrator, I created a window catch a value from path item in illustrator.
This value is pathItem.top ("y" in info panel - on illustrator).
In my window, I have 2 controls : 1 edit text and 1 button.
When I click on button, script catch value (pathItem.top) and put it in edit text (in window).
Problem : When I move path Item in illusrtator with cursor, script can't give me new value (pathItem.top), he keep old value (script is "freezen").
Sometimes, script give me new value but I have move path Item in illustrator with transformation panel in illustrator.
I recorded a little movie from my computer to show you it, I give you link from Youtube (if you have a problem, tell me) : Refresh info from Illustrator - forum Illustrator Scripting - YouTube
My code is in end of this post, if you want I can send you file .jsx.
Can you give me your help, please.
Aaah and sorry for my bad english, I try to write good message to ask help, thank you, thank you. ![]()
-------------------------------------------------------------------------
My code is :
#target illustrator
var palette01 = 'palette\
{text: "Ma fenêtre",\
ed1: EditText{characters: 20},\
b1: Button{text: "Afficher les valeurs"},\
}';
var maFenetre = new Window(palette01);
var editTextPalette = maFenetre.ed1;
var button01Palette = maFenetre.b1;
var monDoc = app.activeDocument;
var monCalque = monDoc.layers["coucou"];
var atrace01 = monCalque.pathItems["01"];
var messagePalette01 = 'function aa()\
{\
var valeur;\
valeur = atrace01.position;\
editTextPalette.text = valeur;\
alert("Ca marche !")\
};\
aa()';
var aaPalette01 = new BridgeTalk;
aaPalette01.target = BridgeTalk.appName;
aaPalette01.body = messagePalette01;
button01Palette.onClick = function(){aaPalette01.send()};
maFenetre.show();
Ce message a été modifié par : Steven Charles-Charlery
