I was wondering if there was any way to create a shape in illustrator and then attach a script to that shape in the document.
I would like to have a text field inside of my SVG object that updates on resize. So I could create a simple event listener that looked like:
function onResizeEvent(e) {
let lbl=getLabel(e.target);
lbl.text(this.outerWidth+" px");
}
this is just pseudo-code to explain the idea.
even an embedded script like:
onUpdate=function (e) {
let elem=this;
let name=this.name.toProperCase();
let label=getLabel(this);
label.text(name);
};
Maybe even have a running script engine that would pass the events to a list of object.
Could someone write a plugin that would allow this to happen in Illustrator or is this entirely outside he realm of possibilities?