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

[basiljs] unlock master page items

Community Beginner ,
Apr 16, 2013 Apr 16, 2013

Copy link to clipboard

Copied

If i make a new page then it adds all the items of my master page (duh).

However i would like to unlock them so i can use them.

I use basiljs (http://basiljs.ch/) for scripting so this is quite different i suppose.

Some code of how to do it without basiljs would be helpfull as well since it's possible to combine.

#includepath "~/Documents/;%USERPROFILE%Documents";

#include "basiljs/bundle/basil.js";

function draw() {

    // get items from first page

    var items = b.items(b.page(1));

    b.println(items.length);

}

b.go();

TOPICS
Scripting

Views

1.2K

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
Contributor ,
Apr 16, 2013 Apr 16, 2013

Copy link to clipboard

Copied

hello

what you want do is overrides master page items?

try this code.

it can unlock(overrides) master page items.

#includepath "~/Documents/;%USERPROFILE%Documents";
#include "basiljs/bundle/basil.js";
 
 
function draw() {
    // get items from first page
    var items = b.items(b.page(1));
    b.println(items.length);
    
    var mp_items = b.page(1).masterPageItems;
    b.println(mp_items.length);
    forEach(mp_items, function(itm,i){
      itm.allowOverrides = true;
      itm.override(b.page(1));
    } );
    b.println(mp_items.length);
    b.println(items.length);
}
 
 
b.go();

thankyou

mg.

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
Community Beginner ,
Apr 17, 2013 Apr 17, 2013

Copy link to clipboard

Copied

Thank you,

one step closer.

Only the master page items move a lot down and to the left, do you have that as well?

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
Community Beginner ,
Apr 17, 2013 Apr 17, 2013

Copy link to clipboard

Copied

I'm a bit further, i noticed there isn't a offset in every document.

In this one there is:

https://dl.dropboxusercontent.com/u/17630770/scriptievormgeving/basiljs_loadTest/loadTest01.indd

Can someone figure out why it happens in that document?

also basiljs seems to change my units from mm to pt but this doesn't seem to be the problem since in other documents it has no affect.

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
Community Expert ,
Apr 17, 2013 Apr 17, 2013

Copy link to clipboard

Copied

It seems that the version number of your InDesign file is 8.0.0.370.
I would try with the latest bug fix of CS6. That is 8.0.1.

Uwe

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
Community Beginner ,
Apr 17, 2013 Apr 17, 2013

Copy link to clipboard

Copied

LATEST

A new document did it for now but good to know that that might be the problem.

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