• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Accepting Track changes in tables

Explorer ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

We are trying to create a script to accept track changes 

app.activeDocument.stories.everyItem().changes.everyItem().accept();
app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().changes.everyItem().accept();
this is what we've used the first line has cleared the changes in the document outside tables but the second line hasn't cleared the changes in tables. We are using a plugin called SuperTrack but that should link to the track changes in Indesign is this something some one could help with please?
TOPICS
Scripting

Views

357

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

correct answers 1 Correct answer

Guide , Sep 08, 2022 Sep 08, 2022

There is a conversation here:

https://community.adobe.com/t5/indesign-discussions/find-change-specific-tables/m-p/9760163

 

Search for the anchored character.

"<0016>"

Votes

Translate

Translate
Community Expert ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

Both 

app.documents[0].stories.everyItem().tables.everyItem().changes.everyItem().accept();

and

app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().changes.everyItem().accept();

work fine over here. Maybe contact the plug-in developer and report the problem.

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
Guide ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

Are the stories locked, or checked out to InCopy?

 

 

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
Explorer ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

Thank you for your response. I hadn't realised that the table was nested in another table and this seemed to be the problem. I was given a solution which was: 

app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().texts[0].tables.everyItem().changes.everyItem().accept();
This works for what I need would you say it's the best solution?
Thanks again for your help and I am a big fan of your books they got me started with scripting and GREPs
Alex

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
Community Expert ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

Hi @Alex25077296wbvx,

Your code will still not get all the tables in the document. It will work only on the 1st level of nested tables. To get all the tables however deep they are nested in a table, try the following code

/*
https://community.adobe.com/t5/indesign-discussions/accepting-track-changes-in-tables/td-p/13181717

Script to get an array of all the talbes present in a document
Pre Requisite:- The script needs an open document
Warning :- No elaborate error checking

Author:- Manan Joshi
Guthub Repo :- https://github.com/Manan-Joshi/InDesign-Scripts.git
*/
function getTables(pCol){
    var retval = [];
    var tables = pCol.everyItem().tables.everyItem().getElements()
    retval = retval.concat(tables)
    for(var i = 0; i < tables.length; i++){
        retval = retval.concat(getTables(tables[i].cells))
    }
    return retval
}

var tables = getTables(app.documents[0].stories)

-Manan

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
Guide ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

LATEST

There is a conversation here:

https://community.adobe.com/t5/indesign-discussions/find-change-specific-tables/m-p/9760163

 

Search for the anchored character.

"<0016>"

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