Skip navigation
Sashikala Balasubramanian
Currently Being Moderated

execute Illustrator actions

Jun 8, 2012 3:07 AM

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
Replies
  • Currently Being Moderated
    Jun 8, 2012 11:45 AM   in reply to Sashikala Balasubramanian

    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…

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 2:42 AM   in reply to Sashikala Balasubramanian

    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.
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 4:27 AM   in reply to Sashikala Balasubramanian

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

     

    You had to search not in the guide (which is just a getting started guide), but in Adobe Illustrator (Your Version) Scripting Reference. For CS5, I found it on p. 114ff.

     

    The Help menu in the ESTK could have told you this as well.

     

    ... or what Muppet Mark said. (Which is the same information, by the way, as in the Scripting Reference *and* in the ESTK Help.)

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 5:12 AM   in reply to [Jongware]

    I do like that I can c&p it here and it all look pretty… I almost look like I know what Im doing…

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points