Copy link to clipboard
Copied
Help. The reason I need this is, our designers have created a huge Indesign document that i need to Psd to send to our web guys.
Ive found a scipt that converts indesign to psd layered perfectly but each element of the Indesign doc has to be on a layer!!.
Help!
Copy link to clipboard
Copied
not to hard i think:
var doc=app.activeDocument;
var pi=doc.allPageItems, l=pi.length;
while (l--)
{pi
move(doc.layers.add()}; alert("Done!\nYou can go outside an play now!");
can't test for now, so let me know.
ps. depending on document.. you can go outside an play UNTIL it finishes
Copy link to clipboard
Copied
Copy link to clipboard
Copied
it is a javascript, not a appleScript.
change the extension to JSX
Copy link to clipboard
Copied
Copy link to clipboard
Copied
uups.. forgot a paranthesis.. (and a dot, it seems)
sorry:
var doc=app.activeDocument;
var pi=doc.allPageItems, l=pi.length;
while (l--) {pi
move(doc.layers.add() };alert("Done!\nYou can go outside an play now!");
my machine finaly finished exporting so i can test it.
notes:
it won't work if you have groups, either ungroup them or.. I will try to do something, but not today.
it will go into master pages and move everything on differnet layers.
Copy link to clipboard
Copied
Appreciate your help!
Copy link to clipboard
Copied
@Vamitul – you still forgot a dot and a paranthesis…
And it will not only work with Group objects, but will fail on anchored objects, too.
A better approch will be to duplicate the objects to new layers. But also with that method there is a risk: the position of duplicated anchored objects will change and to single out objects out of groups means getting into trouble, too:
var doc=app.activeDocument;
var pi=doc.allPageItems, l=pi.length;
while (l--) {pi
.duplicate(doc.layers.add())}; alert("Done!\nYou can go outside an play now!");
Before script (TextFrame with anchored object on the "blue" layer):
After script (TextFrame without anchored object on the green layer, the now duplicated un-anchored object on the "red" layer):
And another thing: if an anchored object has "Text Wrap: on" the text of the duplicated object will reflow.
So, you have to store the positions of anchored objects and set them back to its original.
Another thing about groups: in duplicating single objects out of a group, you will loose any effect that is applied to the group.
So you have to single out groups of your pageItems.
You see it's getting complicated here…
Maybe it's worth thinking about NOT using "allPageItems" but the simple "pageItems". Then "Groups" will stay "Groups" and anchored objects will remain anchored:
var doc=app.activeDocument;
var pi=doc.pageItems, l=pi.length;
while (l--) {pi
.move(doc.layers.add())}; alert("Done!\nYou can go outside an play now!");
Uwe