1 Reply Latest reply on Jul 2, 2009 7:01 AM by Thomas B. Nielsen

    [JS CS3/4] Store data from app.selection[0] even after deselection

    Loic.Aigon Adobe Community Professional

      Hi,

      I am facing a matter that I can't find a way out.

       

      To be brief, I am trying to store app.selection[0].contents (some text) & get access to that value even after the text is deselected.

       

       

       

      In case I am wrong (May be :-S), let me detail the process of my script:

       

      1. A user selects some text

      2. The user launches the script

      3. The script picks the contents of the selection

      var sel=app.selection[0];

      var myOriginalContents = sel.contents;

      4. ...makes a index reference & topic

      5. ...generates the index on last page

      6. ...find original contents in the index text frame

      app.findTextPreferences.findWhat=myOriginalContents;

      app.findText();

      7. ..selects found text

      app.select(app.findText()[0]);

      8. ...adds a hyperlink (source = text; destination = original selection page, name = myOriginalContents).