Skip to main content
June 8, 2012
Question

execute Illustrator actions

  • June 8, 2012
  • 1 reply
  • 1666 views

I created an action to change the width of an image. I execute the action using DoScript javascript method.

The first action Obj1 will select the whole image and second action Obj2 will open the transform panel and change the width of the image.

        app.Open("D:\LWW_Castoff\45991_09_03.eps")
        app.DoScript("Obj1", "LWW")
        While (app.ActionIsRunning)
            Thread.Sleep(500)
        End While

        app.DoScript("Obj2", "LWW")
        While (app.ActionIsRunning)
            Thread.Sleep(500)
        End While

In the above code, the second action 'Obj2' is not getting executed. Both the actions  are getting executed individually. Let me know  the problem and how  to

execute both the actions.

regards,

Sashi

This topic has been closed for replies.

1 reply

Inspiring
June 8, 2012

Im sorry I can't help with your code but the same DOM is available to AS JS & VB there is NO need for actions in any of these to do what you want… You have resize() and transform() methods… Only call on action if the DOM does not give you access…

June 9, 2012

iam unable to find the methods resize and transform in JS guide. Let me know where i had to search.

Inspiring
June 9, 2012

What are you using to look these things up? This is pageItems as in the PDF, OMV and Jongs viewer

Methods

Instances

void bringInPerspective (positionX: number, positionY: number, perspectiveGridPlane: PerspectiveGridPlaneType)
Place art object(s)in perspective grid at spedified perspective plane and coordinate.

ParameterTypeDescription
positionXnumberPosition towards X direction of specified or active perspective grid plane.
positionYnumberPosition towards Y direction of specified or active perspective grid plane.
perspectiveGridPlanePerspectiveGridPlaneType:
PerspectiveGridPlaneType.NOPLANE
PerspectiveGridPlaneType.LEFTPLANE
PerspectiveGridPlaneType.RIGHTPLANE
PerspectiveGridPlaneType.FLOORPLANE
Type of perspective grid plane.

PageItem duplicate (relativeObject: Object, insertionLocation: ElementPlacement)
Duplicate this object.

ParameterTypeDescription
relativeObjectObject
insertionLocationElementPlacement

PageItem move (relativeObject: Object, insertionLocation: ElementPlacement)
Move the object.

ParameterTypeDescription
relativeObjectObject
insertionLocationElementPlacement

void remove ()
Deletes this object.

void removeAll ()
Deletes all elements.

void resize (scaleX: number, scaleY: number[, changePositions: bool=true][, changeFillPatterns: bool=true][, changeFillGradients: bool=true][, changeStrokePattern: bool=true][, changeLineWidths: number=100.0][, scaleAbout:Transformation=Transformation.CENTER])
Scale art object(s)

ParameterTypeDescription
scaleXnumberHorizontal scaling factor expressed as a percentage (100 = 100%)
scaleYnumberVertical scaling factor expressed as a percentage (100 = 100%)
changePositionsboolAre art object positions and orientations effected? (default: true) (Optional)
changeFillPatternsboolAre the fill patterns assigned to paths to be transformed? (default: true) (Optional)
changeFillGradientsboolAre the fill gradients assigned to paths to be transformed? (default: true) (Optional)
changeStrokePatternboolAre the stroke patterns assigned to paths to be transformed? (default: true) (Optional)
changeLineWidthsnumberThe amount line widths are to be scaled (expressed as a percentage) (default: 100.0) (Optional)
scaleAboutTransformation:
Transformation.DOCUMENTORIGIN
Transformation.TOPLEFT
Transformation.LEFT
Transformation.BOTTOMLEFT
Transformation.TOP
Transformation.CENTER
Transformation.BOTTOM
Transformation.TOPRIGHT
Transformation.RIGHT
Transformation.BOTTOMRIGHT
The point on the art item's bounding box to which the scale is applied. (default: Transformation.CENTER) (Optional)

void rotate (angle: number[, changePositions: bool=true][, changeFillPatterns: bool=true][, changeFillGradients: bool=true][, changeStrokePattern: bool=true][, rotateAbout: Transformation=Transformation.CENTER])
Rotate art object(s)

ParameterTypeDescription
anglenumberAngle of rotation (in degrees). Rotation is performed counter-clock wise.
changePositionsboolAre art object positions and orientations effected? (default: true) (Optional)
changeFillPatternsboolAre the fill patterns assigned to paths to be transformed? (default: true) (Optional)
changeFillGradientsboolAre the fill gradients assigned to paths to be transformed? (default: true) (Optional)
changeStrokePatternboolAre the stroke patterns assigned to paths to be transformed? (default: true) (Optional)
rotateAboutTransformation:
Transformation.DOCUMENTORIGIN
Transformation.TOPLEFT
Transformation.LEFT
Transformation.BOTTOMLEFT
Transformation.TOP
Transformation.CENTER
Transformation.BOTTOM
Transformation.TOPRIGHT
Transformation.RIGHT
Transformation.BOTTOMRIGHT
The point on the art item's bounding box to which the rotation is applied. (default: Transformation.CENTER) (Optional)

void transform (transformationMatrix: Matrix[, changePositions: bool=true][, changeFillPatterns: bool=true][, changeFillGradients: bool=true][, changeStrokePattern: bool=true][, changeLineWidths: number=100.0][, transformAbout:Transformation=Transformation.CENTER])
Transform art object(s) using a transformation matrix.

ParameterTypeDescription
transformationMatrixMatrixThe transformation matrix to be applied to the objects.
changePositionsboolAre art object positions and orientations effected? (default: true) (Optional)
changeFillPatternsboolAre the fill patterns assigned to paths to be transformed? (default: true) (Optional)
changeFillGradientsboolAre the fill gradients assigned to paths to be transformed? (default: true) (Optional)
changeStrokePatternboolAre the stroke patterns assigned to paths to be transformed? (default: true) (Optional)
changeLineWidthsnumberThe amount line widths are to be scaled (expressed as a percentage) (default: 100.0) (Optional)
transformAboutTransformation:
Transformation.DOCUMENTORIGIN
Transformation.TOPLEFT
Transformation.LEFT
Transformation.BOTTOMLEFT
Transformation.TOP
Transformation.CENTER
Transformation.BOTTOM
Transformation.TOPRIGHT
Transformation.RIGHT
Transformation.BOTTOMRIGHT
The point on the art item's bounding box to which scale and rotation operations apply. (default: Transformation.CENTER) (Optional)

void translate ([deltaX: number=0.0][, deltaY: number=0.0][, transformObjects: bool=true][, transformFillPatterns: bool=true][, transformFillGradients: bool=true][, transformStrokePattern: bool=true])
Reposition art object(s)

ParameterTypeDescription
deltaXnumberHorizontal transformation. (default: 0.0) (Optional)
deltaYnumberVertical transformation. (default: 0.0) (Optional)
transformObjectsboolAre art object positions and orientations affected? (default: true) (Optional)
transformFillPatternsboolAre the fill patterns assigned to paths to be transformed? (default: true) (Optional)
transformFillGradientsboolAre the fill gradients assigned to paths to be transformed? (default: true) (Optional)
transformStrokePatternboolAre the stroke patterns assigned to paths to be transformed? (default: true) (Optional)

void zOrder (zOrderCmd: ZOrderMethod)
Arranges the art relative to other art in the group or layer.

ParameterTypeDescription
zOrderCmdZOrderMethod:
ZOrderMethod.BRINGTOFRONT
ZOrderMethod.BRINGFORWARD
ZOrderMethod.SENDBACKWARD
ZOrderMethod.SENDTOBACK
How to arrange the art.