Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Search/Replace of NumberingLists [JS][CS6]

$
0
0

Hi All,

 

I'm trying to handle multiple languages in the same document. Each language will have a layer of its own.

In order for this to work the numbering lists must be set for each layer. Otherwise numbering is combined across layers and languages.

 

The script has to search and replace the numberinglists used on the given layer. That however doesn't work. In fact it seems I have hit multiple problems in CS 6.02b409 on Mac + Windows (also tested with CS 5.x):

 

1. Preflight-object returned on manual search

   // When search for a numbering list is set using InDesign UI the script will return a preflight-object instead of a NumberingList object

   var myFind = app.findTextPreferences.appliedNumberingList; // returns a preflight-object

 

2. Color-object returned on scripted search

   // When search is set using scripting the script will return a color-object instead of a NumberingList object

   // Same as described in comment #4 on http://forums.adobe.com/message/3889290?tstart=31

   app.findTextPreferences = NothingEnum.nothing;

   app.findTextPreferences.bulletsAndNumberingListType = ListType.numberedList;

   app.findTextPreferences.appliedNumberingList = "[Default]";

   var myFind = app.findTextPreferences.appliedNumberingList; // returns a color-object

 

3. Can't set findTextPreferences.appliedNumberingList

  // You can only set appliedNumberingList app.findTextPreferences.appliedNumberingList to "[Default]"

  app.findTextPreferences = NothingEnum.nothing; // Reset search

  app.findTextPreferences.bulletsAndNumberingListType = ListType.numberedList;

  app.findTextPreferences.appliedNumberingList = "[Default]";

 

When setting findTextPreferences.appliedNumberingList to anything but [Default] the result is "Expected NumberingList.... but received NumberingList". 

 

Any ideas on what I'm doing wrong?


Viewing all articles
Browse latest Browse all 37788

Trending Articles