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

To give object style to xml tag using script

New Here ,
Jul 09, 2017 Jul 09, 2017

Copy link to clipboard

Copied

Hi,

How to apply objects styles for a xml element using script. Please do guide me.

Thanks in advance,

Revathi

TOPICS
Scripting

Views

1.1K

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
People's Champ ,
Jul 10, 2017 Jul 10, 2017

Copy link to clipboard

Copied

Have you tried anything we can look at ?

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
New Here ,
Jul 10, 2017 Jul 10, 2017

Copy link to clipboard

Copied

Hi,

I tried the below code in my script,

function MapCellSylesToObjectStyles()

{

for(var i=1;i<myDocument.cellStyles.count();i++)

{

var myCellStyle = myDocument.cellStyles.item(i);

var myObjectStyle = myDocument.objectStyles.item(myCellStyle.name);

if(myObjectStyle==null)

{

myObjectStyle = myDocument.objectStyles.add({name:myCellStyle.name});

}

if(myObjectStyle!=null)

{

myCellStyle.appliedObjectStyle = myObjectStyle;

}

}

}

But it showing an error which i have mentioned below.

                                             error.PNG

Thanks in advance,

Revathi

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
People's Champ ,
Jul 10, 2017 Jul 10, 2017

Copy link to clipboard

Copied

Hi,

You main issue indeed is that you can't associate an Object Style to a Cell Style. You can do this with paragraph styles however.

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
New Here ,
Jul 10, 2017 Jul 10, 2017

Copy link to clipboard

Copied

Hi,

How to do this with paragraph style. please do guide me.

Thanks in advance,

Revathi

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
New Here ,
Jul 11, 2017 Jul 11, 2017

Copy link to clipboard

Copied

Hi,

I tried to apply character style using  "characters.appliedCharacterStyle = stylame; ".

And then tried to apply paragraph style using "characters.appliedParagraphStyle = stylame; ",

Both worked for me. But when I tried to apply object style "characters.appliedObjectStyle = stylame; ".

I am getting an error,

               error.PNG

How shall I apply object styles using script.

Thanks in advance,

Revathi

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
People's Champ ,
Jul 11, 2017 Jul 11, 2017

Copy link to clipboard

Copied

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
New Here ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

Hi Loic,

I could not find object style mapping. Is object style mapping possible in indesign?

Thanks in advance,

Revathi

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
People's Champ ,
Jul 12, 2017 Jul 12, 2017

Copy link to clipboard

Copied

LATEST

I think I answered to that one already.

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