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

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

Engaged ,
Mar 03, 2022 Mar 03, 2022

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!

 

Bildschirmfoto 2022-03-03 um 14.57.02 (2).png

 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

Views

153
Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Report

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