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

I just realized that the Grep for ID storage does not contain a lookup range?

Guide ,
Jun 07, 2025 Jun 07, 2025

I've searched the XML file for a long time, but I can't find the option I set for "document" or "article" scope.

Looks like I'm wrong again.

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Query>
<Header>
<Version major="5" minor="1">
</Version>
<Application value="Adobe InDesign">
</Application>
<QueryType value="Grep" qid="1">
</QueryType>
</Header>
<Description>
<FindExpression value="(?&lt;=m|M)(2|3)(?!\d)">
</FindExpression>
<ReplaceExpression value="">
</ReplaceExpression>
<FindChangeOptions>
<IncludeLockedLayers value="0">
</IncludeLockedLayers>
<IncludeLockedStories value="0">
</IncludeLockedStories>
<IncludeMasterPages value="0">
</IncludeMasterPages>
<IncludeHiddenLayers value="0">
</IncludeHiddenLayers>
<IncludeFootnotes value="1">
</IncludeFootnotes>
<KanaSensitive value="1">
</KanaSensitive>
<WidthSensitive value="1">
</WidthSensitive>
</FindChangeOptions>
<FindFormatSettings>
</FindFormatSettings>
<ReplaceFormatSettings>
<TextAttribute type="cstyle" value="上标">
</TextAttribute>
<TextAttribute type="changecondmode" value="0">
</TextAttribute>
</ReplaceFormatSettings>
</Description>
</Query>

 

TOPICS
Bug , Feature request , How to , Scripting , Type
88
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

correct answers 1 Correct answer

Community Expert , Jun 08, 2025 Jun 08, 2025

Ah, I see what you are running into here. You are looking at an InDesign Find/Change Query (.xml) export and wondering why there is no scope specified like document or article?

 

You are correct in thinking that the scope of where a GREP query runs (document vs selection vs story vs article) is not stored in the .xml file of the Find/Change Query. That is not a bug, that is simply how InDesign’s Find/Change system works. The query stores what to find, how to find it, and replace settings, but no

...
Translate
Community Expert ,
Jun 08, 2025 Jun 08, 2025
LATEST

Ah, I see what you are running into here. You are looking at an InDesign Find/Change Query (.xml) export and wondering why there is no scope specified like document or article?

 

You are correct in thinking that the scope of where a GREP query runs (document vs selection vs story vs article) is not stored in the .xml file of the Find/Change Query. That is not a bug, that is simply how InDesign’s Find/Change system works. The query stores what to find, how to find it, and replace settings, but not where to run it.

I realised this with Find Forwards and Find Backwards is not stored, frustrating. 

 

The scope is chosen at run time by you, in the Find/Change panel or by the script or UI you are using.

 

app.activeDocument.changeGrepPreferences = NothingEnum.NOTHING;
app.activeDocument.findGrepPreferences = NothingEnum.NOTHING;
app.activeDocument.findGrepPreferences.findWhat = "(?<=m|M)(2|3)(?!\\d)";
app.activeDocument.changeGrepPreferences.appliedCharacterStyle = app.activeDocument.characterStyles.itemByName("superscript");

app.activeDocument.changeGrep();

 

In this example, the scope is the whole document, defined by app.activeDocument.

 

I think this is correct for just selection

app.selection[0].changeGrep();

 

You are not wrong. The XML does not and cannot define scope.

The scope is defined at runtime. As far as I know there is no way to embed a scope (Document, Story, Article) into the .xml query file.

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