Skip to main content
James Gifford—NitroPress
Legend
June 4, 2022
Answered

Importing Word character styles

  • June 4, 2022
  • 3 replies
  • 593 views

I... just sorta learned that Word manages character styles a bit better than I knew. 'Nuf sed.

 

When character styles are imported, they have a little 'imported' glyph in the list. The only way I can find to make this tag go away is to edit the style, at a minimum, to tweak its name. Is there an easier way to clear this marker — when, for example, the style is fine as-is, including name?

 

This topic has been closed for replies.
Correct answer Barb Binder

Hi @James Gifford—NitroPress and @Eugene Tyson:

 

There is a script in this thread.

https://community.adobe.com/t5/indesign-discussions/remove-style-icons/m-p/1115924

 

That said, like Eugene, I use style mapping on import, which helps me differentiate between the styles I want and the styles I can get rid of quickly.

 

~Barb

3 replies

Community Expert
June 7, 2022

Hi James,

thankfully Barb discovered Harbs' scripting solution!

 

I'll give you something to play based on Harb's idea:

 

 

( function()
{

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

app.doScript
(
	removeImportedFromCharStyles, 
	ScriptLanguage.JAVASCRIPT, 
	[],
	UndoModes.ENTIRE_SCRIPT, 
	"Remove \"Imported\" Icon from Styles | SCRIPT"
);

function removeImportedFromCharStyles()
{

	var allStyles = app.documents[0].allCharacterStyles;

	for( var n=0; n<allStyles.length; n++ )
	{
		if( allStyles[n].imported )
		{
			var currentName =allStyles[n].name ;
			var dup = allStyles[n].duplicate() ;
			allStyles[n].remove( dup );
			dup.name = currentName ;
		};
	};

};

}() )

 

 

You can undo the result of this script in one go.

Focus is on character styles.

 

If you want do a variation where paragraph styles are the target simply exchange this line:

 

var allStyles = app.documents[0].allCharacterStyles;

 

with:

 

var allStyles = app.documents[0].allParagraphStyles;

 

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Barb Binder
Community Expert
Barb BinderCommunity ExpertCorrect answer
Community Expert
June 5, 2022

Hi @James Gifford—NitroPress and @Eugene Tyson:

 

There is a script in this thread.

https://community.adobe.com/t5/indesign-discussions/remove-style-icons/m-p/1115924

 

That said, like Eugene, I use style mapping on import, which helps me differentiate between the styles I want and the styles I can get rid of quickly.

 

~Barb

~Barb at Rocky Mountain Training
James Gifford—NitroPress
Legend
June 5, 2022

Yes, mapping styles on import is defintely the correct approach. I was mostly wondering if I had missed some sort of 'clear' or 'reset' option on a quick drag-and-drop placement. Sometimes those things hide deep in context menus and the like.

 

But that's a hack, more or less, and mapping styles is the right approach. Thanks, both of you.

 

Community Expert
June 5, 2022

You just have to tweak the style - like hitting the underline option or something and then reverting it. Any alteration makes it go away.

 

I don't know if there's a way to script this - to make the tag disappear, that would be cool.

But I typically have a folder of the styles - say, a folder called Text, and in that I have bold, underline, italic, bold italic.

 

Imported word styles, I delete them and/or map them to the Text folder.

 

Works for me and keeps my styles clean and not introducing something inherited from Word.