/ Id-Extras Forum / Tables and Cells and Scripts, Oh My!
I am a long-time Adobe LiveCycle Designer (LCD) user, having to switch to InDesign in a new position to create forms. In the forms, I often use tables and was able to embed text fields, combo boxes, and other objects into the cells so that they move and flex with the table in LCD. I have found it is not as easy in InDesign. One workaround I found was converting the table cell from text to graphic, then using Buttons and Forms to make it a fillable text field. The only issue with that is not being able to center or control the alignment in the text field. I am currently demoing FormMaker Pro, which my company will purchase for me. It appears that I would not be able to use it to align the text under the Options tab as I would in Acrobat. Is there a script I could use on the field to control the alignment of the text, even if it is only to center it? Otherwise, I would have to overlay text frames converted to interactive fields over the table cells using snap to grid. That would make it harder to edit if I have to move or resize the table in the future. I appreciate any assistance.~~Ariel~~Participant
I think what you’re describing is more or less possible with forms in InDesign.
You can anchor a text field in InDesign to a table cell. That’s easy to do, and the text field would then move around with the cell.
To get the text field to exactly fill the dimensions of the cell and change in size if the cell is resized is not a built-in feature of InDesign.
However, it should be possible to automate – meaning that if the size of cells changes, you would run a script on that table and all text fields would resize themselves to the new cell dimensions.
I wouldn’t recommend using the idea of converting a table cell to a graphic cell and then turning it into a form field, because you would lose too many features of FormMaker that way — they all rely on the fields being text frames, since that is the only way to apply formatting such as font, colour, alignment, and so on,in FormMaker.
So again, I would keep your fields as text frames in InDesign. Copy and paste a frame into each cell. Run a script which I can provide to fit the size of the frames to the cells in the table.
I think that would be almost as easy as it was in LiveCycle!
Thank you, Ariel!
I had tested before what you had proposed about anchoring text fields in the cells. What I found is that since my tables are anywhere from 6 to 10 columns and 50 rows, I have to create the first row with all of the properties in each field (font, size, alignment, text or combo box, etc.) and name each ending in “1”. Then I duplicate the row of fields up to 50 times, which increments the number at the end of the name by one. I would then have to copy and paste each into its corresponding cell. If I need to mass edit any of the properties in the future, I cannot select them in mass, even by the Layers panel. I would have to pick them one by one.
Regarding writing a script for the table, my scripting is currently rudimentary, so I often search for scripts or ask for help. Using the graphic frame within the cell seemed a better option since I can copy the first row as a whole, then paste it in mass into the table. But, it still leaves me unable to change some properties in mass and not being able to align within the field. It seems it may be best to return to creating the table, aligning it to the grid, and overlaying the text fields snapped to the grid. That way, I can keep it all in InDesign while using FormMaker. By the way, I have asked, and my company will be purchasing that for me soon. I appreciate all of your help.
- This reply was modified 8 months, 2 weeks ago by Keltexan.
Just a few points:
(1) If you create a text field outside the table, apply a paragraph style to it (and an object style as well to be on the safe side), and copy it, you can then paste-paste-paste inside each cell in the table in turn. InDesign will increment the name of the field – it should not be necessary to create all the fields outside the table in advance.
(2) Regarding mass editing: If you have applied a paragraph style and object style to this field, you can mass-edit many properties by modifying the paragraph style or object style. This would include adding or changing a stroke around the field, changing the alignment, the colour, the font, etc. etc. So hopefully in most cases you wouldn’t need to do this one by one. (Note, also, that currently FormMaker does not allow selecting several fields and editing their properties all at once. Whether they’re in a table or outside of it, this would need to be done one by one. Hopefully a future update will change this, but for now, that’s how it works.)
(3) I can provide you with a script that will resize all text fields to the size of the cells they’re in. I’ve already got one.
I think the idea of aligning to a grid and overlaying is asking for trouble, unless you’re really sure that the layout is final!KeltexanParticipant
Thank you for the tips, Ariel! I want to try out the script you have described on the fresh rebuild of this table.
When I build this, I intend to make it a template to spawn instances on demand for a multipage form. I am transforming an Excel workbook of a form, and this page has hundreds of rows for instances of large orders. I intend for the field names to increment in batches of 50 per page, i.e., fieldname1 through fieldname50 on the first page, fieldname51 through fieldname100 on the second page, etc. I will try using a past script I found when I was using Adobe LiveCycle Designer and tweak it. If it is successful, I will share it.KeltexanParticipant
Where can I find the script that will resize all text fields to the size of the cells they’re in? I have searched the site and forum but have not found it.~~Ariel~~Participant
It’s not on the website, it currently works a cell at a time, so I’ll need to update it to work on the whole table at once.
I’ll try and send it to your email next week — remind me!