[CS3 JS] Replacing/Adding text in a table

Hello professionals....
I am currently wanting to replace text within a table.
The Table has 4 simple colums. All text in the table has the same character style.
b The situation is
i Here is a short 'cut-out' of the scripting I have done:
I read in the text bthat needs to be modified from the table with this script:
> app.findTextPreferences.appliedCharacterStyle = myRevIndexListCharStyleName;
f = myDoc.findText();
var myCurrentResponsiblePerson = f[2].contents;
var myCurrentComments = f[3].contents;
New text is set to another variable:
> var myResponsiblePersonField = textEditboxes.add({editContents:myCurrentResponsiblePerson, minWidth:myTextBoxWidth});
var myCommentField = textEditboxes.add({editContents:myCurrentComments, minWidth:myTextBoxWidth});
var myCourseRevIndexPerson = myResponsiblePersonField.editContents;
var myCourseRevIndexComment = myCommentField.editContents;
I then proceeded to to make a new 'replacement' string:
> var myCourseRevIndexList = myRevIndex+"\t"+myCourseRevIndexDate+"\t"+myCourseRevIndexPerson+"\t"+myCourseRevIndexCom ment;
return[myCourseRevIndexList]
Then I try to 'Change' the text by this:
> app.findTextPreferences.appliedCharacterStyle = myRevIndexListCharStyleName;
app.changeTextPreferences.changeTo = oneResult[0];
oneDoc.changeText();
Result - InDesign Crashes...!
What am I doing wrong?
I know it has something to do with the:
> app.findTextPreferences.appliedCharacterStyle = myRevIndexListCharStyleName;
app.changeTextPreferences.changeTo = oneResult[0];
Because when I deactivate this part - InDesign does
b not
crash!
Would it be better to
i somehow
replace the individual text 'cells'?
If so - how do I do that?
I have treid to read up, but have had no luck!
Help / insights would be greatly welcomed.
Thanks in advance.
Lee

Hello,
:) Sorry - I should have explained a little more!
btw - the linked 'pdf' file is blocked for me! Our IT department are very fussy!!! :(
b What is your main idea?
We have a 3 sided document (Title page, Content page, Release page) to present our product - Training Courses.
On each side of the document there are certain informations that are the same. To make life easy for the people editing these documents, it was decided to make a script to automate the input and changing of these informations.
Character Sytles were generated to define each field of information, so to aid in the find/Change of the scripting.
On the Title page there is the 'Course Title', 'Course Reference No.' and 'Document No.' information.
On the Content page there is the 'Course Title', 'Course Sub-Title', 'Reference No.' and 'Document No.' informations (naturally there is all the course info too, but that's a 'one-time-entry' only).
On the Release page there is all the above and a
b table
that contains the latest revision index information. i.e. Revsion Index, Date of Changes, Responsible Person, Comments to changes made.
This row of information has a Character Style and is read in.
I then searched the string and replaced each Array position with the previously entered text.
It seems to work OK for when you are creating the
b first document
My problem what I see coming is the fact that when it is needed to enter a revision - how would I
b add
another row
b and
then select only the last row of - then to be 'blank' information?
Did this help?
If it might help - here is the InDesign 'template' file that they start with:
http://www.freetimecorner.ch/joomla2/images/allsorts/course_description_end.txt
b NOTE
Change the 'txt' for 'indt'
In the script you'll have to change the address when he goes to open this file (
i in the top few lines

Similar Messages

  • [AS] CS3- Find any text with style, then replace that text with a new applied fill color.

    I am trying to find the simplest way in cs3 to find any text with style, then replace that text with a new fill color. I can find text and change text. I can find a style and change it to a new style. I can't seem to find a style and change the applied fill color. I do not want to change the properties of the style, just the applied color. Yes, I want the + sign, for now. I know, why not update the style, I am not allowed to. Any help would be great. Since the search is not available, I need a new response.
    Thanks.

    You can work around the bug by just doing a find, then looping through the<br />results, changing the color one at a time. It'll be a fraction slower, but<br />should do the trick:<br /><br />tell application "Adobe InDesign CS3"<br />    set find text preferences to nothing<br />    set properties of find text preferences to {applied paragraph style:"The<br />name"}<br />    set theFinds to find text document 1<br />    repeat with i from 1 to count of theFinds<br />        set properties of item i of theFinds to {fill color:"Replace color"}<br />    end repeat<br />end tell<br /><br />The bug is fixed in CS4, BTW.<br /><br />-- <br />Shane Stanley <[email protected]><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>

  • Removing overset text in empty table rows (InDesign CS5.5)

    I have some overset text in a table that appears to be empty rows.  I've opened story editor so I can remove the text, but I can't select the area that's overset (the red lines).  How does one remove this overset stuff if you can't select it.

    Have you tried adjusting the height of the row to reveal the over set text?
    Or try placing your cursor in the cell in question and just hit the delete key...Sometimes invisible characters like column break can be accidently added.
    Or perhaps, highlighting the entire row and hit the backspace key.

  • How to search text in the table?

    Suppose, I've selected some fragment in my document, and I need to find and replace some text in it. Everything is ok, untill I select a part of a table with this text. Does anyone has idea, how to search through the selected cells in the table? Or, just how to iterate them?
    Thanks!

    var doc = app.ActiveDoc;
    var tbl = doc.SelectedTbl;
    // Navigate to the first selected row.
    var row = tbl.FirstRowInTbl;
    while (row.ObjectValid() === 1) {
        if (row.id === tbl.TopRowSelection.id) {
            break;
        row = row.NextRowInTbl;
    // Process the selected rows.
    while (row.ObjectValid() ===1) {
        cell = row.FirstCellInRow;
        while (cell.ObjectValid() === 1) {
            if ((cell.CellColNum >= tbl.LeftColNum) && (cell.CellColNum <= tbl.RightColNum)) {
                // Do something here...
            cell = cell.NextCellInRow;
        if (row.id === tbl.BottomRowSelection.id) {
            break;
        row = row.NextRowInTbl;
    This should do what you want.
    Rick

  • Is it possible to add new columns with format "Text" once a table is linked to a form

    Is it possible to add new columns with format "Text" once a table is linked to a form in Numbers for iPhone or is it impossible and thus a serious bug?(Rating stars and numeric vales seem to work.)
    Those bugs happen both for new speadsheets as well as existing onces, like the demo. When you are in the form only the numeric keyboard shows up.
    Pat from the Apple Store Rosenstrasse/Germany approved that it looks like a Bug during the Numbers Workshop I was in: It is not possible to add new columns with format "Text". I reported the error for Version 1.4 but there is no update nor do I get statement of understanding the issue.

    Hi Knochenhort,
    I see what you are talking about now. Without knowing how the program actually works, I think this is what's going on:
    When you add a new column to an already existing table (with already existing formats), the new cells come already formatted like the previous column. So when you add a column to the end of the demo table, the cells are already formatted like stars, and when you add a column to the beginning, they're already formatted like number.
    I think this is why it's different when if you add columns to a table with blank (unformatted) columns. In that case, the new cells aren't already "tainted" with a set format, so you can change to text format without issue.
    It seems like the problem is that you can't format cells that are already formatted as "number" as "text" format (even if it doesn't look like they are, because they are blank). IMO, this is a bug! This is why you don't see this issue when adding columns to a new table, because the new cells don't already come with a format.
    To workaround, you can highlight the body cells after adding the new column, and delete the cells. This will "clear" the formatting, so you can then go in the inspector, format them as text, and the correct keyboard will pop up.
    Hope that helps!

  • PO by email "Replacement of Text symbol"

    Hi All,
    We have activated PO by email & for email subject in outlook we have done following settings.
    In the output type "Replacement of Text we have kept programme "SAPMM06E" & Form routine "TEXT_SYMBOL_REPLACE" .
    In the title we have kept "&EKKO-EBELN& &LFA1-NAME1&" PO number & the Vendor Name in the mail subject.
    Now the problem is some time system is giving PO number correct but vendor name not as per the PO vendor.
    PO is create with 5710000001 XYZ vendor name & the message subject will come 5710000001 ABC vendor.
    Waiting for reply.
    Thanks in advance
    Samir

    Hi Samir,
    In the title replace the exisitng one with &EKKO-EBELN& &EKKO-LIFNR& - &AM07M-NAME1&
    Just give a try.
    As u have referrred the table LFA1 without vendor in PO , therefore it might be displaying the first vendor name in the table.
    Regards
    Ramesh Ch

  • Adding text to 0MOVETYPE and 0MATMREA

    Hi all,
    I'm working on adding text to infoobjects 0MOVETYPE and 0MATMREA, and have localized the tables in source system and created extractor for both tables. Filling 0MOVETYPE works fine, but 0MATMREA is a problem. The field "reason for movement" (GRUND in MSEG table) is directly connected to the movement type.
    In source table for reason for movement (T157E) the field Movemen type is also a key, and the text table for an infoobject does not contain this many keys.
    Example - source table looks like this
    Language - Movetype - reason - text
    EN            -  101          - 1          -  poor quality
    EN            -  102          - 1          -  Shrinkage
    When the field Movetype is not key in infoobject I get duplicate records.
    Does anyone have any ideas on how to best solve this issue?
    Thanks
    regards,
    Øystein

    Hi,
    (The infoobject looks to 0MOVETYPE to determine which text to use)
    i did not get this part...
    But yes if u have corresponding value of 0MOVETYPE coming form the source u can map it in transformation.It should work fine.
    Regards,
    Rathy

  • Can we replace OTR text with Images?

    Hi All,
    I just wanted to know can we replace OTR text with Images?
    or
    Can we define an image as an OTR text? so that it can be placed in the page where OTR text is used.
    regards...
    Ravi

    Hi Ravi,
    it is possible to replace an OTR Text with an image.
    You first have to define the Link in the OTR Text where your image is located. This can be everywhere in the Internet or better on a secured intranet server which everyone can reach easily without permission problems. Maybe in the DMZ.
    You can even link it into the MIME Repository of your SAP System as well.
    Then you have to put that OTR Text into a
    <htmlb:textview> Tag and ensure that the switch
    " encode = "TRUE" is enabled.
    Well thats all.
    Keep in mind that the a different language, set in the Internet Explorer or other viewing instances, disables the link if it not "translated" into that language.
    This can also be an advantage if you got multilingual fixed pictures with drawn text in it.
    I suggest you put all your links ( with a Value Field and at least a name field) into a seperate table into the repository for easy maintaining.
    Greetings,
    Dominik
    Edited by: Dominik Lemke on Dec 19, 2007 12:02 PM

  • Adding a Row to Table, ComboBox as a  TableCellRenderer Problem !!

    Hell All:
    I have a JTable with one of the Cell as ComboBox. Initially I draw the JTable with Three Rows and the
    the ComboBox in the Second Column works fine. I see each comboBox has different Items. The ComboBox also has a Renderer (as I am customizing the Item's Text )
    Here is the snippet from my Code.
    ==========================
    // UIEditSubAllocation.ALT_ACCOUNT = 2;
    // Get the Viewindex.... to get the correct column
    int viewIndex = this.m_suballocTable.convertColumnIndexToView(UIEditSubAllocation.ALT_ACCOUNT);
    // get the Table Column...
    TableColumn altActColumn = this.m_suballocTable.getColumnModel().getColumn(UIEditSubAllocation.ALT_ACCOUNT);
    // Create Three ComboBox..
    JComboBox[] altActCell = new JComboBox[3];
    for (int i =0;i< 3;++i) // adding Three Rows of Table Data...
    String [] alternateAccounts = new String[4];
    for(int j = 0; j < alternateAccounts.length; j++) // Each Alternate Accounts i.e combobox has 4 items..
    alternateAccounts[0] = "Tom";
    alternateAccounts[0] = "Vic";
    alternateAccounts[0] = "Tracy";
    alternateAccounts[0] = "Andy";
    altActCell[i] = new AltAccountComboBox(alternateAccounts,this.m_suballocTable);
    } // End of adding Three Rows
    altActColumn.setCellRenderer(new AltAccountTableCellRenderer());
    if (viewIndex >= 0)
    ComboBoxEditor altActCellEditor = new ComboBoxEditor(altActCell);
    altActColumn.setCellEditor(altActCellEditor);
    The CombBoxEditor code is...
    ublic class ComboBoxEditor extends DefaultCellEditor
    * Constructs a ComboBoxEditor that uses an array of items of type object.
    * @param items - an array of items of type object
    public JComboBox[] m_comboBox;
    public ComboBoxEditor(JComboBox[] box)
    super(box[0]);
    m_comboBox = box;
    for(int i = 0; i < box.length; i++)
    m_comboBox.setEditable(false);
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
    if(row >= this.m_comboBox.length)
    return super.getTableCellEditorComponent(table, value, isSelected, row, column);
    return m_comboBox[row];
    But when I click a Button (in a Panel) which adds a Row (with No values for the ComboBox ).. to the Jtable .. The Row Gets added fine.. but the JComboBox comes with Values from the First Row's ComboBox. I Don't want any Values in the JComboBox for the new added Row. Can someone tell me
    how do I remove the Items from the ComboBox.
    I will really appreciate for any help...
    Thanks
    -Pankaj

    Hi ,
    as per my opinion one approach would be that ,
    you create a custom table region same as standard one using Jdeveloper and create other required fields also using jeveloper ,and then put this region in extend property of existing standard table region .
    thanks
    Pratap

  • Centering text within a table in Contribute

    I'm using Contribute on a PC doing testing for a professor's
    website. Per my suggestion, the professor purchased Contribute to
    edit his pages. Pages are using a table to format the page.
    http://www.iun.edu/~edupjb/teaching/E340/course_description.shtml
    Within a table Contribute will not let us center text. Since
    a cell is used to put the main content, we cannot center the cell.
    If another table is added inside the cell, even if we try to use
    cell properties, which we can change to center, the text inside the
    table does not center. The align icons can not be selected.
    Any ideas?

    With the design of the pages, the right area is where the
    content is located which is in one cell. Centering one or a few
    lines within the content area is not working within Contribute. The
    whole content area is not wanted to be centered just specified
    lines within the td. Centering in DreamWeaver or Microsoft Front
    Page are inside a td is possible. Contribute is not letting us
    center if trying to do so from within a table.
    Thank you for your suggestion. I'll have to try doing it
    through css. Since Dreamweaver and Front Page can center within a
    table, I don't like having a css definition for something should be
    cared for in the program. It would be a class of Center, which the
    program should be able to center We have about less than 10 people
    using contribute and others mostly using Front Page or Dreamweaver.
    I'll keep testing.
    Could this be a bug in Contribute?

  • When entering text into a table letters are very slow to show up.

    When I enter text into a table, the text loads VERY slowly. What's that about?

    Problem 1: In Table A, when adding or updating data, I want to select data from fields in records based on primary key in other tables. Add and update data works. But my popup "X" list is way too long. I want the popup "X" when adding or
    updating record in Table A to only give me the choice of records from Table B that matches the data I entered in a previous field in Table A, not all the records from Table B.
    For this question, you can create SortTable screen to sort the data based on table A and table B. is this what you need?

  • The text in the tables is hazy when printed in the new version of pages. How can I get this to the same clear text as before?

    In the new version of Pages, the text in the tables are no long clear and sharp as before, they look embedded on all print outs. How can I change this.

    You can do a check for corrupted fonts and other font issues:
    *http://www.thexlab.com/faqs/multipleappsquit.html - Font Book 2.0 Help: Checking for damaged fonts
    *http://www.creativetechs.com/iq/garbled_fonts_troubleshooting_guide.html

  • Photoshop CC : Workspace Flashing Black When Inserting Guides & Completely Black When Adding Text

    I recently bought Photoshop CC (2 Days Ago) and shortly after installing I jumped onto Photoshop CC and started to set up the prefferences for my personal use and started to just do some basic stuff and see whats new in CC. when inserting Guides & adding Text the workspace started to flash/stay BLACK. I don't know whats going on but my specs are better than the minimum requirements? Any idea whats going on? Operating System : Windows 8.1

    Have a look through this step by step guide.
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    It's coming up 1am here, so I am calling it a night.

  • Highlighting text in a table cell

    Im trying to get text in a table have it background shaded a different colour to the rest of the table cell but it doesnt work. No exceptions are thrown does anyone have any idea.
    public Component getTableCellRendererComponent(JTable table,
            Object value,
            boolean isSelected,
            boolean hasFocus,
            int row,
            int column)
            setFont(table.getFont());     
            this.setText(value));
            this.selectAll();
            this.setSelectionColor(new Color(0,0,255,100);
            return this;
        }

    The answer is similar to what someone else asked recently for highlighting text in a JFormattedTextField cell.
    class MyFocusListener extends FocusAdapter
    public void focusGained(FocusEvent e)
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    selectAll();
    Put that in your cell editor or its base class. You can change the color or whatever you want. I think the problem is a timing thing where normal focus processing is interrupting your changes. So give the focus processing time to run with this Runnable triggering your processing to occur on the Awt thread (as is proper) after the system is doing whatever it wants to do. Let us know if it works for you.

  • Adding data to multiple tables using one form in Access 2010?

    Hi All,
    I have a access database with two tables and I want to create a single form to enter data into that tables.
    How to adding data to multiple tables using one form in Access 2010?
    I don't have to much knowledge of access database?
    Please help me
    Thanks
    Balaji

    You really don't enter identical data into 2 tables.  You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables). 
    Maybe you need to read this.
    http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
    Think about it this way...  What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change.  WHOOPS!!  Now, you've got a BIG problem.  For instance, you have a customer
    named Bill Gates.  In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039.  Now you have 2 addresses for Bill.  Why would
    you want that???  Which is right?  No one knows.  If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
    and which is wong...and then update the one that is wrong.
    Post back with specific questions.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

Maybe you are looking for