Don't apply paragraph style to embed image
Hi.
I have a Indesign where I place a word document with text and images via script. Something like this:

Now, I am trying to map the styles from word to new styles created on indesign. I am doing that using GREP, and it's working fine.
//base funtion to map one style into another
function mapPStyleIntoAnother(basePStyle, newPStyle) {
//Clear the find/change grep preferences.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
//Set the find options
app.findChangeGrepOptions.includeFootnotes = false;
app.findChangeGrepOptions.includeHiddenLayers = false;
app.findChangeGrepOptions.includeLockedLayersForFind = false;
app.findChangeGrepOptions.includeLockedStoriesForFind = false;
app.findChangeGrepOptions.includeMasterPages = false;
app.findGrepPreferences.appliedParagraphStyle = basePStyle;
//Apply the change
//app.changeGrepPreferences.underline = true;
app.changeGrepPreferences.appliedParagraphStyle = newPStyle;
myDocument.changeGrep();
//Clear the find/change preferences after the search.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
}
However, Indesign is considering that the image is part of a paragraph style (marked with the arrow on the image below), so when I map the base "body text" paragraph style into "New body text" the image goes on top of the text.

The new paragraph style has this properties:
"psName": "Body PS",
"appliedFont": "Domaine Text",
"fontStyle": "Regular",
"pointSize": 12,
"leading": "14.4pt",
"spaceAfter": 0,
"spaceBefore": 0,
"justification": "left",
"alignToBaseline": true,
"hyphenation": false,
"leftIndent": "0pt",
"firstLineIndent": "12pt"
I discovered that the problem is on leading value. If I don't define a leading value on the new paragraph style everything works fine. However I would like to define it.
There's a way to ignore paragraphs with images on GREP search? Or can I remove the image from the paragraph? Or there is another solution?
Thank you so much for your time!
