PiXELS3D & AppleScript Revisted
Power to the People

Use Apple's Script Editor to Command PiXELS 3D Studio

 

Introduction

Last week we touched upon using PiXELS3D & AppleScript. The tutorial demonstrated how to send commands to PiXELS3D via an AppleScript droplet. This week will will learn how to get values from PiXELS3D and use them in our script.

This tutorial requires:

Pixels3D | studio | v3.0 or greater

AppleScript

Creating the Script
Scripts can be created inside the ScriptEditor application. This application is located in your AppleExtras folder. ScriptEditor can save out standalone scripts as well. This entire tutorial will use ScriptEditor.

In ScriptEditor you can view the data sent to your script in the result window. PiXELS3D sends data back as simple strings. AppleScript makes it easy to parse these strings.

Create and Run the Script
 tell application "Studio 3.7"


(* Get a list of all object *)
set theObjects to (do script "objectlist")

end tell
Now type this code in the the ScriptEditor and run it. You should be presented with the object list in the result window. As stated PiXELS3D returns the command result as a string which can then be parsed by the ScriptEditor.
More Information
 You can get more information on AppleScript by pointing your browser to http://www.apple.com/applescript. You can download help modules from this site that help you learn more about AppleScript. AppleScirpt is also available in MacOSX, in the Classic, Carbon, and Cocoa layers.