Writing to Table Contents was working... and now it's not?
Hello all you masters of the InDesign universe...!
I created a fairly extensive script that, in part, writes user-input data into established tables based on the TextFrame label. It was all working completely fine until I moved that "table-writing" component into a Function, and now the script just stops when it gets to this line:
globalFrames[i].contents = jobCustomerText; I am using the ".contents" method because I need to read and write with this data.
The jobCustomerText variable is defined outside of the Function after the user inputs that data, and right before the line in question, I can see that the variable does indeed contain the correct data, although the variable type comes in as "undefined."
When I copy this component into its own separate file to run/debug (and forcing the jobCustomerText variable to contain a specific string), it works as expected.
Previously, I was using this line:
globalFrames[i].contents = jobCustomer.text; But I found with moving the component to a Function, I had to store this data differently, so now the variable gets filled as:
jobCustomerText = jobCustomer.text;I suspect this doesn't given anyone here much to go on, unless there's some overall reason why it might not work (like .contents just doesn't execute properly within a function, or some silliness)... but I'm at a loss, and I'm really hoping to not have to go back to the bare bones of this project!
