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

Search and select table columns by content and run grep find/change

New Here ,
Apr 26, 2019 Apr 26, 2019

Hi all.

I have a document with lots of tables, all of which have different amounts of columns.

I need to apply brackets around all of the text within a 'Notes' column, but this column does not feature in every table.

I was thinking that a script which selected any column containing the word 'Notes' and then ran a grep search on the selection (figures only) would be a quick way to achieve this.

For the grep search I was thinking that this would work:

app.findGrepPreferences=app.changeGrepPreferences=null;

app.findGrepPreferences.findWhat="\d+";

app.changeGrepPreferences.changeTo="($1)";

app.activeDocument.changeGrep();

but am struggling with the find/select element.

I'd be very grateful of any help.

Many thanks.

TOPICS
Scripting
855
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
Community Expert ,
Apr 26, 2019 Apr 26, 2019

Try "(\\d+)"

-Manan

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 ,
Apr 26, 2019 Apr 26, 2019

And in case you are using CC 2019: Update to 14.0.2 and do the manual Update

Fixed issues in InDesign

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
New Here ,
Apr 26, 2019 Apr 26, 2019

Sorry, to clarify, I need help with the portion of a script that can search for the word 'Note' in multiple tables and then select those columns, where I can then have the grep script run.

Many thanks

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
Enthusiast ,
Apr 26, 2019 Apr 26, 2019
LATEST

Here is how you would get a list of table columns with cells containing "Note" in AppleScript:'

tell application "Adobe InDesign CC 2019"

  tell document 1

  set myList to parent column of every cell of every table of every text frame where paragraph 1 of it contains "Note"

  end tell

end tell

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