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

InDesign is crushing when trying to execute the following script..

Community Beginner ,
Feb 10, 2011 Feb 10, 2011

Copy link to clipboard

Copied

changeToArrow();

function changeToArrow(){
replaceText('_MID_ROW_UP','@#!','<25B2>');
replaceText('_MID_ROW_NoChange','#@!','—');
replaceText('_MID_ROW_DOWN','!#@','<25BC>');
}

function replaceText(a_char_style,a_find_what,a_change_to){
app.findChangeTextOptions = NothingEnum.nothing;

app.findTextPreferences = NothingEnum.nothing;

app.changeTextPreferences.appliedCharacterStyle =  document.characterStyles.item(a_char_style);//_MID_ROW_DOWN

app.findTextPreferences.findWhat = a_find_what;//down-arrow(!#@)

app.changeTextPreferences.changeTo =a_change_to;//<25BC>

app.findChangeTextOptions.includeFootnotes = false;

app.findChangeTextOptions.includeHiddenLayers = false;

app.findChangeTextOptions.includeMasterPages = false;

app.findChangeTextOptions.includeLockedStoriesForFind = false;

app.findChangeTextOptions.includeLockedLayersForFind = false;
var results = app.changeText(false);//In this line InDesign is cushing..
}

Any one know the reason behind it?

TOPICS
Scripting

Views

343

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 ,
Feb 10, 2011 Feb 10, 2011

Copy link to clipboard

Copied

The error is probably a few lines earlier:

app.findChangeTextOptions = NothingEnum.nothing;

You can't set options to zero, you have to set them to true or false, as in

app.findChangeTextOptions.includeFootnotes = true;

Peter

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 ,
Feb 13, 2011 Feb 13, 2011

Copy link to clipboard

Copied

LATEST

Hi Peter,

I have changed the code according to you. But it didn't work.

Thanks,

Mrinmoy

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