Copy link to clipboard
Copied
It is not easy to copy all elements from one document to another document with a Javascript.
I have found an error in the programming for objects of the type "text on path".
By copy & paste the value of textFrame.startTValue is set to 0 instead of keeping the old value. Very annoying!
And here my Javascript to copy this to a new document:
var vDocRef = app.activeDocument;
var vArtboard = vDocRef.artboards[0];
var aAR = vArtboard.artboardRect;
var vPosXY = vDocRef.pageItems[0].position;
var vOldValue = vDocRef.pageItems[0].startTValue; // get the start text value (A)
vDocRef.pageItems[0].selected = true;
app.copy();
var newDoc = app.documents.add();
newDoc.artboards[0].artboardRect = aAR;
app.activeDocument = newDoc;
app.paste();
newDoc.pageItems[0].position = vPosXY;
app.executeMenuCommand("fitall");
app.redraw();
alert("stop, see the wrong position of the text on the path. " + newDoc.pageItems[0].startTValue + " is not " + vOldValue + " – Correct it."); // (B)
newDoc.pageItems[0].startTValue = vOldValue; // correct the start text value (C)
( A ) need to save the startTValue
( B ) shows the problem/bug
( C ) put the old startTValue to the copied textFrame.
Copy link to clipboard
Copied
This is not what I get (in CS6). The two startTValues are the same (without correcting them).
Copy link to clipboard
Copied
Thanks for testing. But I have the problem in CC 2020 and CC 2022. Look's like a bug to me.