Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

copying to new document by javascript - it's a bug

Engaged ,
Mar 03, 2022 Mar 03, 2022

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!

 

Bildschirmfoto 2022-03-03 um 14.57.02 (2).pngexpand image

 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.

TOPICS
Scripting
155
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Mar 03, 2022 Mar 03, 2022

This is not what I get (in CS6).  The two startTValues are the same (without correcting them). 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 10, 2022 Mar 10, 2022
LATEST

Thanks for testing. But I have the problem in CC 2020 and CC 2022. Look's like a bug to me.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines