Adobe Extended Script ExternalObject (aes_externalobj)
A Rust implementation of Adobe ExtendScript external object interface, allowing creation of native extensions for Adobe applications.
Motivation
ExtendScript is based on JavaScript ES3, which is quite outdated. The old interface has a C/C++ based external object, which allowed you to create your own extensions. The goal of this project is to provide a Rust implementation of the ExtendScript external object interface, but with a more modern and safe Rust wrapper around the C ABI.
Installation
Add these dependencies to your Cargo.toml:
[]
= "0.1.0"
= "0.2" # Required for function signature registration
Usage
To create an ExtendScript external object, you need to use the provided macros:
use ;
// Version function
// Initialization function
// Termination function
// Example function that returns a greeting string
// Example function with multiple arguments
// Example function that handles JavaScript code
// Example function that works with LiveObjects
Then in ExtendScript you can use it like this:
// Load the external object
var ext = ;
// Call string function
var message = ext.;
; // Shows "Hello from Rust, World!"
// Call function with multiple arguments
var greeting = ext.;
; // Shows "Hello from Rust, John 25!"
// Work with JavaScript code
var result = ext.;
// Clean up
ext.;
Supported Types
The library supports the following types for function arguments and return values:
String- ExtendScript strings (signature: "s")i32- Signed 32-bit integers (signature: "d")u32- Unsigned 32-bit integers (signature: "u")f64- 64-bit floating point numbers (signature: "f")bool- Boolean values (signature: "b")JsScript- JavaScript code (signature: "a")LiveObject- ExtendScript live objects (signature: "o")
Function signatures are automatically generated based on argument types. For example:
HelloFromRust_s- function takes one string argumentHelloArgs_sd- function takes string and integer argumentsEvalJS_a- function takes any type argument (JavaScript code)CreateObject_o- function takes object argument
Building
Prerequisites
- Rust 1.56 or higher
ctorcrate for function signature registration
Build Commands
Documentation
For detailed documentation, visit docs.rs/aes_externalobj
Features
- Basic implementation
- Macro-based function exports
- Automatic signature generation
- JavaScript code handling
- Live objects support
- Extend SoServerInterface
- Add JavaScript objects
- Complete documentation
- Enhanced error handling
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under dual MIT/Apache-2.0 license. See LICENSE-MIT and LICENSE-APACHE for details.
Acknowledgments
- Adobe Systems for ExtendScript technology
- The Rust community for excellent tools and support