Quartz Composer JavaScript Reference

These pages provide a growing reference for the JavaScript facilities and API built into Quartz Composer, Apple's Xcode Tool, (included in the default installation of Applications within the OS X Developer Tools folder, as of OS X Tiger onwards). This site also provides a space to record the author's own experiments and explorations with QC3. Please note that the example files for QC3 conformant JavaScript usually contain the corresponding QC2 conformant patch, translated from the original QC2 example, represented with the permission of Kazuhiro Furuhata, via OpenSPC.

In QC2 users were somewhat constrained as to how inputs and outputs were created by configuration of the JavaScript patch. In addition, the JavaScript performance was by no means the snappiest in QC2. With the release of Leopard, came Quartz Composer 3 and a few changes to how JavaScript is formatted in the JavaScript patch.

QC3 users were presented with a scripting patch that gave them far greater liberty to fully code in standard JavaScript and improved scripting performance in the Viewer window. The primary differences between QC3 JavaScript and browser JavaScript rests in the formatting of the function and the lack of the usual DOM references. Otherwise, it is pretty easy to port a lot of your existing JS code, sans DOM, to QC3.



Seedheads

QC3 JavaScript is quite a remarkable and effective assemblage of Core JavaScript objects, properties and methods. QC3 JS supports both current, deprecated and cutting edge JavaScript properties [properties, indeed, that were still being rolled out in what were the two most frequently installed browsers, Firefox and Internet Explorer respectively].

Using JavaScript in Quartz Composer is notably different from working with JavaScript in almost any other application, even within a rich media, graphics creation application like Flash, wherein much of the in built scripting support is understandably oriented towards the production and support of browser delivered, event driven , rich media interfaces and presentations. There is a tangibly direct relationship between the routines coded in the QC3 JavaScript patch and the resulting graphics output generated by the recipient render and consumer patches.

Currently their is no browser support for QC files, at the time when such support existed, it was limited by reasons of framework and plugin distribution base to Safari and any other WebKit plugin capable, OS X installed browser. See the WebKit Plugin page for further details on exploiting Quartz Composer compositions within Safari [WebKit plugin browsers].

This current lack of cross platform, cross browser support for Quartz Composer compositions really matters little as such on the only platform currently supporting such compositions, namely OS X Tiger and Leopard.

For those of us wanting to to originate and program our own compositions, plugins and patches we only have to install the standard Developer's Tool package and open up Quartz Composer. For those wishing to only be consumers and users of Quartz Compositions, most will work in QuickTime Player unless specifically protocolised to only work as visualizers, screensavers and such. In that case, they will work as expected in their native environment.

Some compositions will depend upon the installation of 3rd party plugins.Redistribution of such plugins as a part of an installation package for the composition is entirely dependent upon the terms of the authors of that plugin. Thus far, this author has not found any plugin that can't be scripted upon its inputs, or be used to obtain data to be incorporated into some other from of compositional routine. A by no means exhaustive list of QC plugins can be found upon this site's resources page

QC JavaScript is radically direct in the way it operates upon input data and outputs results that support the generation of graphical structures and images.



Visualizer

Although Quartz Composer uses JavaScript Core Classes, it does not cover the DOM based use of JavaScript that is probably running in your browser today,     . Of course, learning about JavaScript in Quartz Composer is hardly going to dent your learning curve with DOM based prototype JS. It will, in all probability, help you to gain greater facility in your use of this widely employed scripting language.

Anyone wanting to specifically research or learn about JavaScript in their browser should look instead to the following links:-

 

See the Apple Developer documents for a simple guide to using JavaScript in Quartz Composer.

See the resources page for a fuller set of Quartz Composer and QC JavaScript links.

All QC 2 example scripts point to their original location atOpenSPC

All QC 3 example scripts point to their original location atCybero Designs
 

Errors, updates, insights and any links to

If requesting redistribution from Kazuhiro Furuhata, enquire via OpenSPC.

Restyling, revisions & editing by Cybero Designs (with kind permission of Kazuhiro Furuhata)
 

Visualizer