Page 1 of 1

Masks and Layer Controlls

Posted: August 8th, 2007, 9:44 pm
by explorer
hi everyone

1)
i was wondering if its possible to control mask pins with expressions.
as far as i know (or as far i was able to figure out) it is not possible. or is it?

2)
we all use expressions and expression controls, like sliders, checkboxes and so on. my question is: does anyone know how to set an error trap when in Layer Control you select None as a layer?

it seems that i cannot even check if a selected layer is set to None, because when I try to do it i get en error message, that "layer is set to None - cannot continue".

any ideas how to check if the layer in Layer Control is selected or not?

thanks in advance

Posted: August 9th, 2007, 5:27 am
by Atomic
Javascript does support try and catch. I have only used that in jsx, however, not experssions. But it may be worth a try.

Code: Select all

try
{
//Access your layer code goes here
}
catch (error)
{
//If an error is thrown.
alert (error.description)
}
http://www.w3schools.com/js/js_try_catch.asp

Re: Masks and Layer Controlls

Posted: August 9th, 2007, 10:44 am
by Mylenium
explorer wrote: 1)
i was wondering if its possible to control mask pins with expressions.
as far as i know (or as far i was able to figure out) it is not possible. or is it?
Not possible. Requires plugins, but both toolsets are no longer available.
explorer wrote: 2)
we all use expressions and expression controls, like sliders, checkboxes and so on. my question is: does anyone know how to set an error trap when in Layer Control you select None as a layer?
You can try Atomic's approach, but it's a bit ineffective. It would be simpler to have a dummy layer that is used as an automated reference when nothing else is selected. Also since expressions throw errors anyways, you r custom code might not show up if it#s overruled by a higher-priority problem.

Mylenium

Posted: August 9th, 2007, 3:06 pm
by explorer
thanks.
i did not expect try/catch to work, but it did the job nicely.
thanks again.

Re: Masks and Layer Controlls

Posted: December 18th, 2008, 10:25 am
by valoos
try and catch works correctly ... 8)
thx Atomic