Ok, let's say I have this textFrame selected:
I want to apply this:
To get this expected result:
With this code it's no problem:
var doc = app.activeDocument;
var target = doc.selection[0];
target.fit(FitOptions.frameToContent);
But as soon as I set the content it goes wrong. Even if the content is the same to what it was.
var doc = app.activeDocument;
var target = doc.selection[0];
target.contents = "0209 - Lorem ipsum dolor sit amet consectetur adipiscing elit nam finibus ut justo at fermentum maecenas tincidun libero at aliquet finibus libero sem semper massa.";
target.fit(FitOptions.frameToContent);
Now I get 1 big line!:
Is this a bug, or do I need to trigger an update method or something?