🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
4 messages
4 total messages Started by Johan_Wieland Tue, 30 Dec 2008 12:25
move images to other layer with Javascript
#2350
Author: Johan_Wieland
Date: Tue, 30 Dec 2008 12:25
25 lines
1256 bytes
Hello,

i'm struggling with translating a applescript to javascript.

the script is intended to select all images, and move the selection to a new layer.
that new layer "images" should be not printable and not visible.
at this moment, i made a javascript wich creates the layer, with the right attributes.

the applescript code is:
set IDS to links
 set myLayer to images

			repeat with myCounter from 1 to (count IDS)
				set theFrame to parent of parent of item myCounter of IDS
				 try
					set properties of theFrame to {item layer:myLayer}
				end try
			end repeat

the javascript will be used with Indesing CS3 OSX 10.5

any help will be appreciated.
thanks in advance,

Johan
Re: move images to other layer with Javascript
#2355
Author: Peter Kahrel
Date: Tue, 30 Dec 2008 17:42
9 lines
766 bytes

myLinks = app.activeDocument.links; 
for (i = 0; i < myLinks.length; i++) 
    myLinks[i].parent.parent.itemLayer = 'Layer 2';



Peter
Re: move images to other layer with Javascript
#2356
Author: loic_aigon
Date: Tue, 30 Dec 2008 17:50
16 lines
1223 bytes
//Send all graphics into a specific layer and set this layer to non visible and non printable.

var doc = app.activeDocument;

//Get a collection of graphics in the doc
var imgs = doc.allGraphics;

//Loop through the graphics in the collection
for(i=0; i<imgs.length;i++) { 	//use function move(to) to place graphics in layer named myLayer 	imgs[i].parent.move(doc.layers.item('myLayer')); }

//Set myLayer layer options to be not visible and not printable
doc.layers.item('myLayer').visible=false;
doc.layers.item('myLayer').printable=false;

Hope it helps
Loic
Re: move images to other layer with Javascript
#2130
Author: Johan_Wieland
Date: Mon, 05 Jan 2009 10:18
7 lines
701 bytes
Hello,

thanks for your quick answers. Great.
both scripts are exactly the solution.

greetings.
Johan
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads