Welcome, Guest. Please Login
Rorohiko Workflow Resources
  Welcome the Message Board of Rorohiko Workflow Resources. To register, please e-mail [email protected] - automatic registration has been turned off because of relentless spambots and spammers. This Message Board is not actively monitored. If you have an urgent question, please e-mail [email protected]. If you post it here, it will probably be many weeks before we notice.
  HomeHelpSearchLogin  
 
Page Index Toggle Pages: 1
Send Topic Print
APID - Items on locked layers are not affected (Read 11179 times)
WellerUK
YaBB Newbies
*
Offline



Posts: 5
APID - Items on locked layers are not affected
06/17/08 at 02:24:19
 
Hi there

In my test document I have a little square with event filter set to "modified" and the following script attached:

bBox = theItem.geometricBounds;
point = new Array
point[1] = (bBox[0] + bBox[2])/2;
point[0] = (bBox[1] + bBox[3])/2;
myDoc=app.activeDocument;
myDoc.pageItems.item("frame").paths[0].pathPoints[1].anchor = point;

On another layer there is a simple path with "frame" label.
When i move the square the path reshapes. However when I lock the layer with the path and move the square nothing happens. Is there a way to make it work even though the controlled path is on the locked layer?

Thanks
weller
Back to top
 
 
IP Logged
 
Kris Coppieters
YaBB Administrator
*****
Offline



Posts: 181
New Zealand
Gender: male
Re: APID - Items on locked layers are not affected
Reply #1 - 06/17/08 at 06:44:43
 
Hi WellerUK,

What about something like (quick and dirty conceptual code - for real life use would need to be cleaned up, 'var' declarations added, etc...):


bBox = theItem.geometricBounds;
point = new Array
point[1] = (bBox[0] + bBox[2])/2;
point[0] = (bBox[1] + bBox[3])/2;
myDoc=app.activeDocument;
myFrame = myDoc.pageItems.item("frame");
frameLayer = myFrame.itemLayer;
layerLocked = frameLayer.locked;
frameLayer.locked = false;
myFrame.paths[0].pathPoints[1].anchor = point;
frameLayer.locked = layerLocked;
Back to top
 

Kris
WWW  
IP Logged
 
weller
YaBB Newbies
*
Offline


I Love YaBB 2!

Posts: 10
Re: APID - Items on locked layers are not affected
Reply #2 - 06/17/08 at 08:06:45
 
Hi Kris

I'm at home right now so I cannot test it but it seems like simple idea that will work in practice. (I'm ashamed I didn't think of it before posting the question)

Thanks a lot
weller






Oh by the way. How is it with APID not affecting items on locked layers? Is it an intention or bug?
Back to top
 
 
IP Logged
 
Harbs
YaBB Newbies
*
Offline


Kris Does Great Work ;-)
!

Posts: 13
Gender: male
Re: APID - Items on locked layers are not affected
Reply #3 - 06/17/08 at 09:09:12
 
APID works with objects on locked layers. It's the script which doesn't change anything because the layer is um... locked!
Back to top
 
WWW  
IP Logged
 
weller
YaBB Newbies
*
Offline


I Love YaBB 2!

Posts: 10
Re: APID - Items on locked layers are not affected
Reply #4 - 06/17/08 at 09:20:17
 
Thanks Harbs

I didn't know about this limitation of ExtendScript. It might save me a lot of frustration in the future, now that I know.
Sorry for framing APID, Kris

weller
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print