Is it possible to srcipt something that reads text and make an appropriate image visible?


i have never written script indesign before not familiar how works

 

eessentailly, have text box user writting state in. want script take input, , make hidden image of state visible.

 

also, possible have th script running, or end user have run it?

 

thank you!

hi,

 

it possible using eventlisteners. @ example below , awared example only:

 

to switch on run:

#targetengine "session" var mydoc = app.activedocument; mydoc.addeventlistener("afterselectionchanged", mydisplay);  function mydisplay(myevent){      if(app.documents.length == 0) return;      var curdoc = app.activedocument;      if(curdoc.selection.length == 0) return;       var            myinput = curdoc.textframes.item("input"),            myoutput = curdoc.pageitems.item("output");       if (!myinput.isvalid || !myoutput.isvalid) return;       if (myinput.contents == "on") myoutput.visible = true;       else myoutput.visible = false;   } 

 

to switch off run (or quit indesign):

app.activedocument.eventlisteners.everyitem().remove() 

 

 

assumings:

  • input textframe named "input" (i mean in "layer's panel")
  • output pageitem named "output"
  • type "on" make "output" visible

 

jarek



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?