Copy link to clipboard
Copied
Hi
I nedd to get content of all text frames in selection
Thanks
Try this:
s = '';
for (var i = 0; i < app.selection.length; i++) {
if (app.selection instanceof TextFrame) {
s += app.selection.parentStory.contents + '\r';
}
}
P.
Copy link to clipboard
Copied
Try this,
for(i=0; i<app.activeDocument.pages.length; i++)
{
for(var j=0;j<app.activeDocument.pages.textFrames.length;j++)
{
alert(app.activeDocument.pages.textFrames
.contents) }
}
Copy link to clipboard
Copied
No all text frames (stories) in document but in selection
for example i have 3 frames but i select 2 frames (see picture). I need content from two selected frames
Thanks
Copy link to clipboard
Copied
You may try with script what I gave..
Copy link to clipboard
Copied
Hi,
var mySelection = app.selection;
for ( var s = 0; s < mySelection.length; s++ ) mySelection
.texts[0];
(^/)
Copy link to clipboard
Copied
Like Sajeev code.. if you need only to view the selected text frame content..
for(i=0; i<app.activeDocument.textFrames.length-1; i++)
{
alert(app.selection.contents);
}
Copy link to clipboard
Copied
Try this:
s = '';
for (var i = 0; i < app.selection.length; i++) {
if (app.selection instanceof TextFrame) {
s += app.selection.parentStory.contents + '\r';
}
}
P.
Copy link to clipboard
Copied
Thanks
But this solution don't work when i group frames
Copy link to clipboard
Copied
I change your code and it works.
You have huge knowlege pkahrel
sel = app.selection;
s = '';
for (var i = 0; i < app.selection.length; i++) {
if (sel instanceof TextFrame) {
s += sel.parentStory.contents + '\r';
}
if (sel instanceof Group) {
for (var j = 0; j < sel.textFrames.length; j++ )
s += sel.textFrames
}
}
alert(s)
Copy link to clipboard
Copied
Please mark Peter code to correct answer..