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

selecting text frames on multiple pages

New Here ,
Jan 26, 2009 Jan 26, 2009

Copy link to clipboard

Copied

hello all -

i have a problem i believe is tailor-made for a script, but i don't know enough about scripting to tackle it. in CS3, i have a 300+ page document and i wish to select all text frames and change their Y position. is there a script that exists for this? the "select objects" script in indesign sadly doesn't select across multiple pages.

thanks!
micah
TOPICS
Scripting

Views

936

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
Participant ,
Jan 26, 2009 Jan 26, 2009

Copy link to clipboard

Copied

A script cannot do things that are impossible in the UI. So, selecting on more than one page is not possible.

However, to do what you want, a script doesn't have to select anything.
//DESCRIPTION: move all text frames in document 12 units down


( function() {
if (app.documents.length > 0) {
moveTextFrames(app.documents[0], [0,12]);
}
function moveTextFrames(doc, offset) {
var spreads = doc.spreads.everyItem().getElements();
for (var j = spreads.length - 1; j >= 0; j--) {
spreads.textFrames.everyItem().move(undefined, offset);
}
}
}())
To move by some other amount, change the values (that's x and y in the units you're using) in the moveTextFrames call.

Interestingly, for this to work, you have to go a spread at a time. I expected that:

>app.documents[0].textFrames.everyItem().move(undefined, [0,12]);

would work, but it didn't. Gave me the dreaded: this will cause an item to be moved off the pasteboard message.

Dave

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 ,
Jan 26, 2009 Jan 26, 2009

Copy link to clipboard

Copied

you cannot select all textframes at once as you can't do in the UI.<br />however you can create a collection of textframes and loop thought it to move the positions.<br />var mytf = app.activeDocument.textFrames.everyItem().getElements();<br />for(i=0; i<mytf.length; i++)<br />{<br /> var x = mytf.geometricBounds[1];<br /> var y = 2 //for example;<br /> mytf.move([x,y]);<br />}<br />I tried [undefined,2] but it seems you cannot avoid move only one axis only.<br /><br />Loic

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 ,
Jan 26, 2009 Jan 26, 2009

Copy link to clipboard

Copied

LATEST
Oh Dave has already been by here and already corrected me :-)
b spreads.textFrames.everyItem().move(undefined, offset);
i I tried [undefined,2] but it seems you cannot avoid move only one axis only.

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