Scripter2 API

Layer API
A layer object can be created by as Scripter.activeDocument.layers. All the functions mentioned below are used for manipulation of layers using python scripts.

Sample script: layerObject = Scripter.activeDocument.layers print layerObject.getLayers #this will print the list of layers in active document.

QList getLayers

void setActiveLayer(QString layer)

QString getActiveLayer

void sendToLayer(QString layer, QString name)

void setLayerVisible(QString layer, bool visible)

void setLayerPrintable(QString layer, bool printable)

void setLayerLocked(QString layer, bool locked)

void setLayerOutlined(QString layer, bool outline)

void setLayerFlow(QString layer, bool flow)

void setLayerBlendmode(QString layer, int blend)

void setLayerTransparency(QString layer, int trans)

bool isLayerVisible(QString layer)

bool isLayerPrintable(QString layer)

bool isLayerLocked(QString layer)

bool isLayerOutlined(QString layer)

bool isLayerFlow(QString layer)

int getLayerBlendmode(QString layer)

double getLayerTransparency(QString layer)

void deleteLayer(QString layer)

void createLayer(QString name)

Object API
QString createRect(double x, double y, double width, double height, QString name);

QString createEllipse(double x, double y, double width, double height, QString name);

QString createImage(double x, double y, double width, double height, QString name);

QString createText(double x, double y, double width, double height, QString name);

QString createTable(double x, double y, double width, double height, int numRows, int numColumns, QString name);

QString createLine(double x1, double y1, double x2, double y2, QString name);

QString createPolyLine(QList list, QString name);

QString createPolygon(QList list, QString name);

QString createBezierLine(QList list, QString name);

QString createPathText(double x, double y, QString textbox, QString beziercurve, QString name);

void deleteObject(QString name);

void textFlowMode(QString name, int stat);

bool objectExists(QString name);

void setStyle(QString style, QString name);

QList getAllStyles;

void duplicateObject(QString name);

void moveObject(double dx, double dy, QString name);

void moveObjectAbs(double x, double y, QString name);

void rotateObject(double rot, QString name);

void rotateObjectAbs(double rot, QString name);

void sizeObject(double width, double height, QString name);

QString getSelectedObject(int nr);

long selectionCount;

void selectObject(QString name);

void deselectAll;

QString groupObjects(QList list);

void unGroupObjects(QString name);

void scaleGroup(double factor, QString name);

void loadImage(QString filename, QString name);

void scaleImage(double x, double y, QString name);

void setImageOffset(double x, double y, QString name);

void setImageScale(double x, double y, QString name);

void setImageBrightness(double n, QString name);

void setImageGrayscale(QString name);

bool lockObject(QString name);

bool isLocked(QString name);

void setScaleImageToFrame(bool scaletoframe, bool Proportional, QString name);

void flipObject(bool h, bool v, QString name);

Get Properties of objects.
QString getObjectType(QString name); QString getFillColor(QString name); double getFillTransparency(QString name); int getBlendMode(QString name); QString getLineColor(QString name); double getLineTransparency(QString name); int getLineBlendMode(QString name); int getLineWidth(QString name); int getLineShade(QString name); int getLineJoin(QString name); int getLineCap(QString name); int getLineStyle(QString name); int getFillShade(QString name); int getCornerRadius(QString name); QList getImageScale(QString name); QString getImageName(QString name);

QList getPosition(QString name); QList getSize(QString name); int getRotation(QString name); QList getAllObjects;

Color API
QList getColor(QString name);

QList getColorAsCMYK(QString name);

QList getColorAsRGB(QString name);

void changeColorCMYK(QString name, int c, int m, int y, int k);

void changeColorRGB(QString name, int r, int g, int b);

void defineColorCMYK(QString name, int c, int m, int y, int k);

void defineColorRGB(QString name, int r, int g, int b);

void deleteColor(QString name, QString replace);

void replaceColor(QString name, QString replace);

bool isSpotColor(QString name);

void setSpotColor(QString name, bool enable);