Test if running with After Effects UI

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
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.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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) {
benroll
Posts: 1
Joined: February 10th, 2011, 5:40 am

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.
Post Reply