Page 1 of 1

Test if running with After Effects UI

Posted: February 3rd, 2011, 5:18 am
by benroll
Hi Guys,

Is there a way to test for certain if a script is running inside the After Effects UI?

I am currently testing whether $.fileName contains "Scripts/ScriptUI Panels". It's pretty likely to work, but a user could of course run a script from this location using File->Run Script.

Is there a more robust method?

Thanks.

Ben.

Re: Test if running with After Effects UI

Posted: February 3rd, 2011, 8:45 am
by Paul Tuersley
Do you mean test if the script is running in After Effects, or test if it's running as a dockable panel?

For the second you could use something like:

Code: Select all

if (myPal instanceof Panel) {

Re: Test if running with After Effects UI

Posted: February 10th, 2011, 12:02 pm
by benroll
Paul Tuersley wrote:Do you mean test if the script is running in After Effects, or test if it's running as a dockable panel?

For the second you could use something like:

Code: Select all

if (myPal instanceof Panel) {
Thanks, Paul. That did the trick.

-Ben.