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

find non xml text and apply tag

Community Beginner ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

I need to find non XML text in the indesign file and apply XML tag for those texts.

How to do this via script.

for example : in my file bullet list not having xml structure and the text are inside the xml tag i need to move the bullet inside the xml element

Capture.GIF

TOPICS
Scripting

Views

578

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

People's Champ , Jul 31, 2017 Jul 31, 2017

Are you just sure that is a standalone character and not a bullet set with a  paragraph style ?

If the latter, this content isn't part of the flow itself but a visual representation of a bullet.

Votes

Translate

Translate
People's Champ ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

Are you just sure that is a standalone character and not a bullet set with a  paragraph style ?

If the latter, this content isn't part of the flow itself but a visual representation of a bullet.

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 ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

its character and its not an auto number.

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
People's Champ ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

Probably not bullet proof but a basis snippet:

var main = function() {

var doc = app.properties.activeDocument, text;

app.findGrepPreferences = null;

app.findGrepPreferences.properties = {

findWhat:"~8\\t"

};

if ( !doc ) return;

var found = doc.findGrep();

var n = found.length;

while ( n-- ) {

text = found;

text.move ( LocationOptions.AFTER, text.parentStory.insertionPoints[text.index+text.length+1] );

}

}

var u;

app.doScript ( "main()",u,u,UndoModes.ENTIRE_SCRIPT, "The Script" );

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 ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

Thank you so much

[text.index+text.length+1]. can you please explain the line.

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
People's Champ ,
Jul 31, 2017 Jul 31, 2017

Copy link to clipboard

Copied

LATEST

Well as the idea is to move the text right after the tag marker, we want to compute text index, then shift for as many characters the text counts (we could have hard stated that the length is 2 but still better to see things dynamically), then shift once more to jump over the tag marker (+1). Tag markers are actually special characters, they aren't totally ghost objects.

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