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

app.redo() and app.redraw() delete manually operated Polygon object's undo history

Contributor ,
Aug 12, 2017 Aug 12, 2017

Copy link to clipboard

Copied

Hi all,

On Illustrator CC 2017, there's some particular case become blocker.

I'm trying to work around path.

If there's anything I'm missing, please let me know.

I appropriate any feed backs.

Issue:

Manually operated Undo history got over written at following operation in script.

1) It is only Polygon object

  All other object seems fine.

2) Undo history is by only manual operation

  ex1) Placing Polygon object 10 time by mouse causes issue.

  ex2) Placing Polygon object 10 time by script does not causes issue.

3) Redo issue is by only scripting

Illustrator UI works fine.

4) app.redraw() is actual trigger to delete undo history

  If it is called from CEP plugin CSInterface.evalScript(), it seems has same issue.

  My target environment is CEP plugin.

Test code

#target illustrator

// open document before run

/*

// Following script operation works, but manual placing polygons have issue.

// Place 10 polygon (Hexagon)

for(var i = 0; i < 10; i++){

    $.writeln("polygon: " + i);

    var a = 100 + i * 20;

    activeDocument.pathItems.polygon(a, -a, 10, 6);  // Hexagon

    app.redraw();

    $.sleep(1000);

}

*/

for(var i = 0; i < 5; i++){

    app.undo();

    $.writeln("undo:" + i);

    app.redraw();  // no change

    $.sleep(1000);

}

app.redraw();

for(var i = 0; i < 5; i++){ // Only first redo works

    app.redo();

    // app.executeMenuCommand("redo"); // same behavior

    $.writeln("redo:" + i);

    app.redraw(); // problem on Polygon redo // commenting out works, but document view won't be updated

    $.sleep(1000);

}

app.redraw();

Thank you,

Naoki

TOPICS
Scripting

Views

673

Translate

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
Community Expert ,
Aug 14, 2017 Aug 14, 2017

Copy link to clipboard

Copied

LATEST

Its funny behavior... I try to your code and got same issue.

Probably, It is a bug.

Votes

Translate

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