How do I make a custom shape using Javascript?

I would like to create a trapezoid shape and be able to color it in, just like I'm able to do with the PathItems (e.g. rectangle, ellipse). I would like to be able to do this in Javascript.
I was thinking it might have to do with PathPoints, but Adobe's Scripting Reference Guide does not make it clear.
If anyone could give me some quick sample code on how to do this, I'd be much appreciative. Or just a description would be great.
THANK YOU VERY MUCH

Something like this?
// TrapezPathCreate.jsx
// http://forums.adobe.com/thread/1307731
// regards pixxxelschubser
var aDoc = app.activeDocument;
var aPath = aDoc.pathItems.add();
aPath.name = "Trapez";
// create pairs of coordinates for every anchor point
aPath.setEntirePath(Array([0,0],[50,100],[200,100],[400,0],[0,0]));
aPath.close = true;
aPath.filled= true;
aPath.stroked= false;
var itemColor = new CMYKColor();
itemColor.cyan = 0;
itemColor.magenta = 100;
itemColor.yellow = 100;
itemColor.black = 0;
aPath.fillColor = itemColor;
alert("done");
or this?
var aDoc = app.activeDocument;
var Rect = aDoc.pathItems.rectangle(0, 0, 400, 400, false);
Rect.stroked = true;
Rect.filled = false;
alert("Rectangle created");
Have fun

Similar Messages

  • How can I make a custom book size in iBooks Author

    How can I make a custom book size in iBooks Author?

    Book sizes (Landscape or Portrait) are fixed when using iBooks Author.
    Covers, however, can be square.

  • Adobe pro - print settings: How do i make a custom page size list, which i can copy to my other comp

    Adobe pro - print settings: How do i make a custom page size list, which i can copy to my other computers who have adobe pro installed?

    your right.. i ment acrobat pro :-)
    my problem is that i use the PDF printer to export CAD drawings as PDF´s.
    As it is now, there are some pre-defined page sizes in the print settings, and i know i can add custom pages manually one at a time.
    What i want is to copy the list of my danish standard page sizes, and use them on my other versions of acrobat.
    Its like 70 different sizes, and i have them made manually on my current computer, but i hope its possible to copy the list to other computers.
    Maby its some script where i can define the sizes, and then copy to another computer. Im just not that much of a computer genius :-)
    Hope i got through this without to many spelling mistakes...
    Thanks for helping.

  • How can i make a signature by using lightroom? , is it possible?

    how can i make a signature by using lightroom? , is it possible?

    To can create a text identity plate in LR but to create a graphical version
    requires Photoshop

  • How i can make web application by using oracle form6i

    how i can make web application by using oracle form 6i , indetail .
    A.R

    indetail .As Andy Millman might observe, you're having a laugh. This is a big topic, far exceeding what it is reasonable to expect people to help out with in a Forum. Do you not have the 6i documentation?
    OTN has a site for upgarding to web forms. Although it is mainly focussed on moving to 9i/10g a lot of the issues and solutions apply to moving a 6i client/server app to web deployment. For further help there is a Forms.
    Cheers, APC

  • How can I hide figures or characts. using javascript in wad report BI NW 7

    Hi,
    How can I hide figures or characteristics using javascript or command in wad report ( BI NW 7).
    I have read the documentation for WEB API, but it doesn't provide some info on that area.
    Thank you.
    Edited by: Sergey Antonov on Jul 29, 2011 3:08 PM

    You can use REMOVE_DRILL_DOWN in WAD to remove characteristic..to remove a keyfigure with a button you could a variable with that button, which makes an invalid selection of the keyfigure though it is 2000, e.g. set CALYEAR = 1900.
    Hope it helps,
    Christian

  • How to get inputtext's inputvalue by using javascript

    how to get inputtext's inputvalue by using javascript?
    and how to judge whether its be filled or empty string

    Why do you want to use javascript..? Why not action listener..? You can check whether its an empty string by checking
    if(str != null && !str.equals("")) {..}
    where str is the variable for inputText value.
    If this is not helpful, do provide more details on which version of JDev you are using and what are you trying (your usecase).
    regards,
    ~Krithika

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • How to Set "DateOnly" property in DateTimeControl using Javascript.

    How to Set "DateOnly" property in DateTimeControl using JavaScript.

    Is there any specific reason you want to set it through JavaScript ? You can directly set the DateOnly property in the markup itself.
    <SharePoint:DateTimeControl runat=server id="dtControl" DateOnly="true"></SharePoint:DateTimeControl>
    Please can you elaborate on what exactly is the requirement for setting this through javascript?
    Geetanjali Arora | My blogs |

  • How do I save a custom shape to use as a text box?

    I've finally worked out how to define a custom shape. Is there any way to save it and use it in other documents?

    Save the document in which it's defined as a template.
    Every document created from this custom template will embed your custom shape.
    Yvan KOENIG (VALLAURIS, France) mercredi 26 janvier 2011 11:30:30

  • How do you make a custom button that is Invisible When not selected

    Im just recently switching over to using a mac for authoring. I really like all the features in DVD Studio more than what i was using on a PC for the past 6 years. Which was ulead DVD Workshop 2.
    The only problem im having (For Now) is that i cant make my custom buttons invisible. I made this little black shape thing in photoshop and i want to use it in DVDSP for selecting different tracks.
    I thought all i had to do was just save the black shape with a transparent background in photoshop as a .psd and import it. But that didnt work.
    When i change episodes it just stays black the whole time. I want something that will be invisible when it is not selected.
    please help
    I can send someone my little shape if they can make it a usable button that i can make invisible in dvdsp. I really need to see the layers done with a shape as a button to see how they were able to make it invisible.
    i tried a few tutorials but instead of being invisible all i got was a shape that was stuck white the whole time. this is even when i put the opacity to 0 on normal.
    I want to make this into a button
    http://img694.imageshack.us/i/custonbutton.png/

    Ok, what you want to do is also in the same tutorial. See the section on "Advanced Highlights" (again, avoid the sections on layered menus), You can create an overlay that does have two colors. The bad news is that there will be absolutely no anti-aliasing at all. This means your graphic will be extremely pixelated. This is just the way the DVD specs are set up, so there is no way around it.
    Given that I would highly recommend redesigning your overlay. Take a look at variety of DVDs from Hollywood. See what they are doing in their menus. You can do anything they are doing, but you will notice that the overlay is very simple because of the limited anti-aliasing of DVDs. In all the years that I've been watching DVDs I've only see one DVD use two colors in the overlay, and that was the Jim Carey "The Grinch who Stole Christmas."

  • How to create a transparent custom shape on a patterned background?

    Hello,
    I've searched the forums and google and cannot seem to find a tutorial for what it is I want to do. I have a document with guides (card template) and I want to create the same design on each grid. I want the grids to have a patterened background and I want a custom shape within it. But, I want the custom shape to be transparent, not to the background, but going through the background. Like a cookie cutter. I want the custom shape to make a hole through the patterend background, leaving nothing in its place. I'm working with CS6 and can't seem to find a tutorial on how to do this. When I create the shape and make it transparent, I can see the background which isn't what I want. I want to go through the background layer and I'm being prompted to rasterize the layer when I've tried doing so. Help is much appreciated!!!

    You've gone two hours without a reply, and I suspect that is because you are not specific enough with your description of what you want to achieve.  I'll try but I will be guessing some of it...
    Make the shape you need to produce the pattern, with transparency for the area you need to 'punch through' as you put it, the background.
    Define that shape as a pattern, and fill a layer with it using the Piant buck set to pattern.
    Now control click the pattern layer to load it as a selection > Invert the selection, and add a layer mask to the underlying layer.  This should show throw to the lower layer(s)
    If I am not there, try uploading the Shape image you want to use as a pattern, and a screen grab of your image showing the layers panel.

  • How do I make a custom brush image in a gradient color scheme in Photoshop Elements 12?

    I want to make a custom brush image in a gradient color scheme.  I know how to change the hue jitter, but I want to "paint" the image with a gradient between two colors.  For example, I have an image of an octopus that I have used to create a custom brush.  I want the top of the octopus to be hot pink and gradually fade into a deep orange at the end of the tentacles.  Everything I've looked up just colors the background.  Thanks in advance!

    Try the following:
    Open the octopus image
    Open a Gradient Map Adjustment layer above this. There are several preset gradients, but in my version of the program I don't see one with pink to orange.
    When you double click on the gradient bar in the Adjustments palette, this will open up the Gradient Editor, where you can tailor the gradient to your specifications with color and opacity stops. (see below)
    This will apply the gradient to the entire picture. However, the adjustment layer has a built-in mask (the white rectangle).
    Left click on this and paint with a black brush to hide the gradient outside of the octopus. If you go too far, you can correct with a white brush.
    Now, as to the Gradient map adjustment layer, here is how to configure it:
    http://retouchpro.com/tutorials/?m=show&opt=printable&id=132

  • Trying to make a custom shape

    I'm attempting to create an object out of a square but I need to change the dimensions of all 4 sides, is it possible to manually input the dimensions of each side? 4 by 6 1/2 by 7 3/4 by 6

    If Photoshop is your only Adobe product like me. Its not the best tool for something like what you want to create.  To do what you want I would open a new Document or your jpeg. The Jpeg I would use the perspective crop tool to crop the EPS Design to square it up some. Then transform that to the correct aspect ratio you want.  I would then add text layers to on it to get as close as I could to the three line using a font that matches the logo.  I would then make shape layers for the three text layer and merge then into a single shape.  I would then edit the shapes path to make it closer to your image design. Then define a custom shape named EPS.

  • How do I make a 3D shape or mesh transparent?

    I have a photo of a bottle I need to mock up with a label I designed. Warping placed graphics isn't doing the trick, it looks wonky. I made a 3D mesh and loaded my label as a texture onto it so that it matches the shape and angle of the bottle. Problem is I don't want the gray mesh shape to be visible, I just want the label itself. I can't for the life of me figure out how to make the shape the label is wrapped around transparent while leaving the label visible. I'm using Photoshop CS4 and have bee looking online for answers but can't find any. Does anyone know how I can make the shape invisible or another method that warps the label in 3D space? Sure am missing the Render > 3D Transform option right about now…

    You might try setting the opacity to zero for the other materials besides the label.
    There is also a wine bottle preset under 3d-New Shape From Layer-Wine Bottle that might work better.

Maybe you are looking for

  • Hiding fields in standard SAP Transactions

    Hi All, We have a requirement to hide some fields in ME51n, ME21n, ME31k,ME11,MIGO,ML81n,MIRO I know we have screen layout at doc level through which we can make the fields as optional, display and mandatory. Please let me know the standard way to hi

  • Printing of cheque under company code instead of business area

    hai sap gurus pls help us in this issue At the time of running automatic payment program separate cheques were printing to a single vendor as per business area, now the client is asking that single cheques is to be issue to the vendor under company c

  • How to determine the root AM?

    Hi, In my application there are many application modules .Please help me to determine which is the root application module.

  • Oracle 10g expdp fatal error (ORA-39125 & ORA-01801)

    Key phrases: ORA-39125 ... DBMS_METADATA.FETCH_XML_CLOB [TABLE_STATISTICS] ... date format is too long Hello, While performing a routine export (expdp) of schemas in an Oracle 10.2 instance on Linux, a fatal error (ORA-39125) was genereted. A screen

  • Is it possible to update my system from 10.5.8 to 10.8 on my (2007?) Macbook?

    Is it possible to update my system from 10.5.8 to 10.8 on my (2007?) Macbook?  The Mountain Lion update page on the apple store says you must have 10.6 to update, but can I update to 10.6, then mountain lion?