Sg2.9
document.activate() does not...
Recent RSS
document.activate() does not work?!
From:  Felix
Date:  7. October 2010, 18:08

Hello Everyone,
I am new to Scriptographer. I don't get how activate() works.

I tried this:

var file = new File('/Users/fvorreit/Documents/Scriptographer/test.ai');
var doc = new Document(file);
doc.activate();
var circlePath2 = new Path.Circle(new Point(400, 200), 100); 

var posterdoc = new Document('poster', 1000, 2000);
posterdoc.activate();
var circlePath3 = new Path.Circle(new Point(400, 200), 100); 

but both circles are drawn in the document were I start the script...

Re: document.activate() does not work?!
From:  Felix
Date:  13. October 2010, 21:00

OK,
wrong question?
I would like to make many new documents and then draw in them. is that possible?

Thank You!

Re: document.activate() does not work?!
Date:  14. October 2010, 11:08

Hi Felix - strange that it doesn't work. We will have to look into this one. In the mean time, could you try:

var doc = new Document('another doc', 1000, 2000); 
doc.activate(); 
var circlePath2 = new Path.Circle(new Point(400, 200), 100); 
doc.activeLayer.appendTop(circlePath2);

var posterdoc = new Document('poster', 1000, 2000);
posterdoc.activate(); 
var circlePath3 = new Path.Circle(new Point(400, 200), 100);
posterdoc.activeLayer.appendTop(circlePath3);
Re: document.activate() does not work?!
From:  Jürg Lehni
Date:  14. October 2010, 12:00

Yes, there appears to be an error in the document switching code. Looking into it right now.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Boxes Flow 19.04.12