Copy link to clipboard
Copied
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."));
Copy link to clipboard
Copied
I visit http://www.adobe.com/devnet/scripting.html
and find each software has one js,
does it has one tools for each?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
See this page for basics of scripting in After Effects and links to the After Effects scripting guide and addenda that Mylenium referred to.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
thanks,
I know the extend meaning.
does it, too, work individually? or have to accompany ae together when debug?
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
I shall try. thanks very much.
that means document class is different alart.
the front is belong to extendscript?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Exactly. Extendscript doesn't have the web/html objects, just the core components of the JavaScript language.
Dan
Copy link to clipboard
Copied
Thank you very much, Dan,
that settles the matter.
Copy link to clipboard
Copied
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?