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

greps in scripts

New Here ,
Dec 08, 2010 Dec 08, 2010

Copy link to clipboard

Copied

I am new to indesign scripting. I am trying to learn with the "Adobe Introduction to Scripting" but so far its just given me a headache.

I have written a few basic scripts but need to study harder!

I would like to write a script for a grep search (find/change returns change them into soft returns (\r - \n)) that only searches in (multiple) tables i.e. ignores/doesn't change returns in the text.

I would really appreciate someone putting me in the right direction.

Dave

TOPICS
Scripting

Views

723

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
New Here ,
Dec 08, 2010 Dec 08, 2010

Copy link to clipboard

Copied

p.s. I am working with CS3

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 Beginner ,
Dec 08, 2010 Dec 08, 2010

Copy link to clipboard

Copied

what about looping through all texts, then loop through it's tables, and search the table.

var YourTable = app.activeDocument.texts.tables (or something)

instead of

app.findGrepPreferences.findWhat ="\n";

then look for

YourTable.findGrepPreferences.findWhat ="\n";

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 ,
Dec 09, 2010 Dec 09, 2010

Copy link to clipboard

Copied

Hi Dave,

I am also new for scripting. Indesign sample scripts will help you with your GREP needs.  Findchangebylist.jsx did what you want. Just open your indesign folder from hard disk go to script folder, choose javascript open Findchangebylist.jsx. It support eith a txt file. read the file carefully, it will solve your headache. Dont forget script will ignore the slashes, for example you grep code is \s means you need to use \\s in script.(that means double slashes)

karthi

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 ,
Dec 10, 2010 Dec 10, 2010

Copy link to clipboard

Copied

LATEST

there is a way to use one of the scripts (the findchangebylist.jsx one) to make chained queries almost like macros in word.

have a read of this thread on indesignsecrets.com:

http://indesignsecrets.com/forum/general-indesign-topics/macroscript-for-multiple-text-find-change-queries

otherwise check out Kasyan Servetsky's find/change by queries:

http://kasyan.ho.com.ua/find_change_by_queries.html

or this effort from automatication

http://www.automatication.com/index.php?id=12

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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