Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Jan 18, 2011 Jan 18, 2011

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."));

jsc5.JPG

TOPICS
Scripting
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 18, 2011 Jan 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jan 18, 2011 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

what I want to know is how to use the tools to debug js?

does it has to use accompany with ae or dreamweave etc?

can it run individually?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jan 18, 2011 Jan 18, 2011

After Effects uses ExtendScript, which is an extended form of JavaScript. It is the same language as is used for Photoshop, Illustrator, and InDesign. It is not the same language as is used for Dreamweaver, Flash, and Fireworks---though it is related. The ExtendScript Toolkit is what you use for writing and debugging ExtendScript.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

thanks,

I know the extend meaning.

does it, too, work individually? or have to accompany ae together when debug?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

can't access to http://www.adobe.com/go/learn_ae_aeenhancershome

and,

btw, back to top thread,

the clue is document is indefine, why take place such problem?

document class shouldn't be included in the tools plateform?

have I to redefine this object again?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

for example, how shall I check, say temperature transforming functin listed out in the top thread, and debug by the js tools?

is it working independently or have to work accompany relative software like ae or dreamw...?

thank you all.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2011 Jan 18, 2011

Going back to your original example, if you change document.write to alert it will execute. You apparently can use the toolkit to write and debug vanilla ExtendScript without specifying a target application. You just won't have access to any of the application-specific extensions.

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

I shall try. thanks very much.

that means document class is different alart.

the front is belong to extendscript?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

I look them over and find that alert belong to Browser object. its a method of window object in DOM. as well as confirm, prompt etc.

wheares document belong to html object, its method of document object, such as document.write etc.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2011 Jan 18, 2011

Exactly. Extendscript doesn't have the web/html objects, just the core components of the JavaScript language.

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011
LATEST

Thank you very much, Dan,

that settles the matter.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

sorry

,I don't know how to express exactly.  see the pic.

each item has an article of js. are they same or not js?

how to express correctly in english?js1.JPG

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines