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

Find Object Gap Color

Engaged ,
Feb 02, 2010 Feb 02, 2010

Hi All,

Please suggest me why below code not working.

var myDoc = app.activeDocument;

app.findObjectPreferences=app.changeObjectPreferences=null;

app.findObjectPreferences.gapColor = myDoc.swatches[1] //paper

app.changeObjectPreferences.gapColor = myDoc.swatches[0] //None

myDoc.changeObject()

app.findObjectPreferences=app.changeObjectPreferences=null;

Thanks in advance,

Shonky

TOPICS
Scripting
662
Translate
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
Contributor ,
Feb 02, 2010 Feb 02, 2010

Hi Shonky,


I think Find & Changing the objects by using colors will not work in InDesign CS3 JS.


Try to do the process in some other way.


Regards,

Ramkumar .P

Translate
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
Engaged ,
Feb 02, 2010 Feb 02, 2010
LATEST

Thanks Ramkumar,

I am using Indesign CS4 and code not working in CS4 too.

I got the solution with below code:

var myDoc = app.activeDocument;

var mypageItems = myDoc.allPageItems

for (a=0; a<mypageItems.length; a++)

{

if (mypageItems.constructor.name == "Group")

{

continue;

}

mypageItems.gapColor = "None"

}

var mygroupItems = myDoc.groups

for (a=0; a<mygroupItems.length; a++)

{

for (b=0; b<mygroupItems.allPageItems.length; b++)

{

if (mygroupItems.allPageItems.constructor.name != "Group")

{

mygroupItems.allPageItems.gapColor = "None"

}

}

}

Its strange that find object not working. My previous code was correct i think.

Shonky

Translate
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