Adobe ExtendScript Toolkit

ExtendScript ToolKit

# Using the SampleLib Example

## Introduction

This page documents how to build and run the SampleLib External Object, which demonstrates both the "direct" and "object" interface to an External Object.

## Building the BasicExternalObject project

### Building on Windows

##### Opening the Project

We assume that you have Visual Studio 2005 installed on your workstation.

1. Navigate to SDKINSTALL/samples/cpp/build/samplelib/win
2. Double click SampleLib.vcproj and/or open the project in Visual Studio 2005. Use the keyboard shortcut Ctrl-Alt-L or View > Solution Explorer if you cannot see the project files.
3. Expand the SampleLib project
   - The project contents should resemble the following:

         SampleLib/
         	Header Files
         		SampleLib.h
         		SoSharedLibDefs.h
         		SoCClient.h
         	Source Files
         		SampleLib.cpp

4. Inspect any of the source files by double-clicking them in the Solution Explorer

##### Building

The project has two different build configurations, Release and Debug. To change to build configuration:

1. Select Build > Configuration Manager
2. In the "Active solution configuration" drop dow, set the desired configuration
3. Press Close

The default path for the project output is dependent on which build configuration was used and will be one of the following:

- SDKINSTALL/samples/cpp/build/samplelib/win/Release/
- SDKINSTALL/samples/cpp/build/samplelib/win/Debug/

To create the library then build the project by:

1. Selecting Build > Build Solution or press 'F7'

If, for example, the Release configuration was used, then the compiled DLL can be found at SDKINSTALL/samples/cpp/build/samplelib/win/Release/SampleLib.dll

### Building BasicExternalObject on Mac OS

##### Opening the Project

1. Navigate to Navigate to SDKINSTALL/samples/cpp/build/samplelib/mac
2. Double click BasicExternalObject.xcodeproj
3. Expand the BasicExternalObject project
   - The project contents should resemble the following:

         BasicExternalObject/
         	Source
         		SampleLib.vcproj.cpp
         		SampleLib.vcproj.h
         		SoSharedLibDefs.h
         		SampleLib.vcproj_Prefix.pch
         	Resources
         		Info.plist
         		InfoPlist.strings
         	External Frameworks and Libraries
         		Carbon.framework
         	Products
         		SampleLib.vcproj.framework

4. Inspect any of the source files by double clicking them in the Groups & Files pane

##### Building

The project has two different build configurations, Release and Debug. To change to build configuration:

1. Select Project > Set Active Configuration
2. Choose the configuration you require

The default path for the project output is dependent on which build configuration was used and will be one of the following:

- SDKINSTALL/samples/cpp/build/samplelib/mac/Release/
- SDKINSTALL/samples/cpp/build/samplelib/mac/Debug/

To create the framework, build the project by the following:

1. Selecting Build > Build or press Cmd+B

If, for example, the Release configuration was used then the compiled DLL can be found at SDKINSTALL/samples/cpp/build/samplelib/mac/Release/BasicExternalObject.framework

The compiled framework can be found SDKINSTALL/samples/cpp/build/samplelib/mac/Release/SampleLib.framework

## Running the Library

Within the SDKINSTALL/samples/cpp/scripts/ folder, you will find a JavaScript file named loadSampleLib.jsx. This script can be loaded into the ExtendScript Toolkit and run from that location.

##### Loading and Running

To load and run the sample from the ExtendScript Toolkit (ESTK):

1. Open loadSampleLib.jsx in the ESTK
2. Run the script by selecting Debug > Run or by pressing F5
3. A dialog window will appear with the option to try direct and object calls with output appearing in the lower text area of the dialog.

Copyright© 2008 Adobe Systems Incorporated. All rights reserved.

Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks