Highlighted

Help with Script to auto tag a folder of paragraph styles

New Here ,
Aug 05, 2020

Copy link to clipboard

Copied

I'm trying to create a script to auto tag my paragraph styles.

I know how to call out specific styles and tag them with a specific tag (H, P, etc.) and even 'all others' with a different tag. 

Is there a way to call out all of the styles in a specific folder?

With some changes that InDesign has made, list styles need to be tagged with [Automatic] ... How would i script to tag all files in 'Lists' folder to [Automatic]

 

thank you!

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

My bad, had only tested with ePub, not PDF. 

 

Just remove all existing style maps instead: 

 

var autoGroup = app.documents[0].paragraphStyleGroups.itemByName("Lists");
var styleTags = autoGroup.paragraphStyles.everyItem().styleExportTagMaps.everyItem().remove();

 

TOPICS
Scripting

Views

67

Likes

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

Help with Script to auto tag a folder of paragraph styles

New Here ,
Aug 05, 2020

Copy link to clipboard

Copied

I'm trying to create a script to auto tag my paragraph styles.

I know how to call out specific styles and tag them with a specific tag (H, P, etc.) and even 'all others' with a different tag. 

Is there a way to call out all of the styles in a specific folder?

With some changes that InDesign has made, list styles need to be tagged with [Automatic] ... How would i script to tag all files in 'Lists' folder to [Automatic]

 

thank you!

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

My bad, had only tested with ePub, not PDF. 

 

Just remove all existing style maps instead: 

 

var autoGroup = app.documents[0].paragraphStyleGroups.itemByName("Lists");
var styleTags = autoGroup.paragraphStyles.everyItem().styleExportTagMaps.everyItem().remove();

 

TOPICS
Scripting

Views

68

Likes

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
Aug 05, 2020 0
Adobe Community Professional ,
Aug 05, 2020

Copy link to clipboard

Copied

You want the ParagraphStylesGroup object. So:

 

var autoGroup = app.documents[0].paragraphStyleGroups.itemByName("Lists");
autoGroup.paragraphStyles.everyItem().styleExportTagMaps.everyItem().exportTag = "[Automatic]";

 

 

 

 

 

 

Likes

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
Reply
Loading...
Aug 05, 2020 0
New Here ,
Aug 05, 2020

Copy link to clipboard

Copied

I recieved an error "Invalid tag for style mapping"

Likes

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
Reply
Loading...
Aug 05, 2020 0
Adobe Community Professional ,
Aug 05, 2020

Copy link to clipboard

Copied

My bad, had only tested with ePub, not PDF. 

 

Just remove all existing style maps instead: 

 

var autoGroup = app.documents[0].paragraphStyleGroups.itemByName("Lists");
var styleTags = autoGroup.paragraphStyles.everyItem().styleExportTagMaps.everyItem().remove();

 

Likes

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
Reply
Loading...
Aug 05, 2020 0
BethKx LATEST
New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

perfect! thank you!

Likes

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
Reply
Loading...
Aug 06, 2020 0