Saturday, March 19, 2011

Week 8 - Learning JavaScript

I am currently learning from these four pieces of documentation:

Adobe Photoshop CS5 -Javascript Scripting Reference (used for this blog)
http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/pdfs/photoshop_cs5_javascript_ref.pdf
Adobe Photoshop CS5 - Scripting Guide
Adobe -Introduction to Scripting
Adobe Creative Suite 5- Javascript Tools Guide.

To learn a subject, one has to take responsibility for learning the subject.

JavaScript functions with specific naming specifications for its classes. For example, if I made a class in JavaScript for Photoshop, this would be the first line:

new EditLayers( );

This line begins with the type new. The documentation refers to this as an operator. Perhaps it just means that the "new" type is letting the class operate as a recent not already catalogued device.

A "new" operator develops a copy of the kind of object that the user has just set up within JavaScript.  

Using already established objects is a little more complicated. Photoshop has its own Photoshop Object Model. There are a groups of objects. Each object is called a container and has a subgroup within it that are "subobjects". These objects can be called within JavaScript code similar to the way that one would call an array.

layer.documents[1] or
documents[5]

Layer in the above example is a variable, which can be used to call documents, the name of a specific subobject in JavaScript. Subobjects can have many different names. To call a subobject, make sure that the object name's first word is not capitalized and the second word is capitalized.

Methods are always actions of somekind, which I learned in my Java class least semester. One can develop completely new objects within the subobjects by using precreated methods to manipulate an object.
Although some objects such as fonts are definite and binding, and therefore cannot be manipulated.

From this documentation, I observed that var is the type used for variables in JavaScript.

No comments:

Post a Comment