Skip to main content
Participating Frequently
January 18, 2011
Question

How to use Javascript Tools? does it has one for each branch?

  • January 18, 2011
  • 1 reply
  • 2613 views

I use jt cs5 and test a file like pic show, when run, it told document is not define.

what's wrong with it? function is as follow,

function f2c(s) {
  var test = /(\d+(\.\d*)?)F\b/g;    // 初始
  return(s.replace
    (test,
      function($0,$1,$2) {
        return((($1-32) * 5/9) + "C");
      }
    )
  );
}
document.write(f2c("Water freezes at 32F and boils at 212F."));

This topic has been closed for replies.

1 reply

zhgartAuthor
Participating Frequently
January 18, 2011

I visit http://www.adobe.com/devnet/scripting.html

and find each software has one js,

does it has one tools for each?

Mylenium
Legend
January 18, 2011

I seriously don't understand what you mean... Yes, each of the apps has its own specific reserved keywords, DOM objects etc. but then what? That script example is not doing anything in AE - it's completely different from web-centric JS. Please read the relevant scripting guides for whatever you plan on doing.

Mylenium

Todd_Kopriva
Inspiring
January 18, 2011

See this page for basics of scripting in After Effects and links to the After Effects scripting guide and addenda that Mylenium referred to.