Copy link to clipboard
Copied
Hello there,
I have a weird issue. I'm updating a textArea.contents with a string, but when I get it back, is not complete... and the amount of stored characters seems to vary randomly...
Here is the code:
And one output as example:
Any Idea what may be causing this? This is only happening on a particular document from a client, any new document we create this works just fine.
Also, the textarea its created by our extension, even on that document it is now working, if we manually erase it and let the extension recreate it, it keeps failing... but, again, just in that particular document...
Any idea what might be causing this behaviour?
Thank you very much,
Marc
Copy link to clipboard
Copied
Hi Marc,
textArea? Isn't that an Illustrator property?
You posted here in the InDesign Scripting forum…
What is the language for your code?
JS for a CEP Panel?
There is a dedicated forum for CEP Panel development:
Extensions / Add-ons Development
Best,
Uwe
Copy link to clipboard
Copied
The variable name is misleading, the object is an actual TextFrame.
Code is JavaScript executed using CSLoader.evalScript.
Its scripting and indesign.
Copy link to clipboard
Copied
"Here is the code..." I tried copying it into the ExtendScript Editor but it did not accept an image. We cannot test it that way.
Copy link to clipboard
Copied
rollwhistler wrote
… I'm updating a textArea.contents with a string, but when I get it back, is not complete... and the amount of stored characters seems to vary randomly...
That may be not randomly at all. 😉
If you ask for textFrame.contents you'll get exactly the contents that is visible in the text frame.
If by any chance it is overset—you added contents before, overset would be likely—you better address the story of the text frame.
textFrame.parentStory.contents
Regards,
Uwe
Copy link to clipboard
Copied
Oh! seems reasonable :-), but sometimes it shortens the string much more than on the example I provided, and the textFrame is dinamically created and hidden, so it shouldn't change its size.
But you probably set me on the good track, I'll make a couple of tests and come back to mark the answer as correct if its my case.
Thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now