How to create a line without using execute action method.

Hi All,
I want to create a line whose weight and co-ordinate are given to me. I am using ActionDescriptor and execute action method to do this.
Here is my code:
    var idcontentLayer = stringIDToTypeID( "contentLayer" );
    var idStrt = charIDToTypeID( "Strt" );
    var idHrzn = charIDToTypeID( "Hrzn" );
    var idPxl = charIDToTypeID( "#Pxl" );
    var idVrtc = charIDToTypeID( "Vrtc" );
    var idPnt = charIDToTypeID( "Pnt " );
    var actRef = new ActionReference();
    actRef.putClass( idcontentLayer );
    var layerDesc = new ActionDescriptor();
    layerDesc.putReference( charIDToTypeID( "null" ), actRef );
    var lineDesc = new ActionDescriptor();
    lineDesc.putClass( charIDToTypeID( "Type" ), stringIDToTypeID( "solidColorLayer" ) );
    var propertyDesc = new ActionDescriptor();
    var strtPointDesc = new ActionDescriptor();
    strtPointDesc.putUnitDouble( idHrzn, idPxl,  startX);                         //startX, startY, endX, endY are given..
    strtPointDesc.putUnitDouble( idVrtc, idPxl, startY);
    var endPointDesc = new ActionDescriptor();
    endPointDesc.putUnitDouble( idHrzn, idPxl, endX );
    endPointDesc.putUnitDouble( idVrtc, idPxl, endY );
    propertyDesc.putObject(  charIDToTypeID( "Strt" ), idPnt, strtPointDesc );
    propertyDesc.putObject( charIDToTypeID( "End " ), idPnt, endPointDesc);
    propertyDesc.putUnitDouble( charIDToTypeID( "Wdth" ), idPxl, weight );               // weight is given.
    lineDesc.putObject( charIDToTypeID( "Shp " ), charIDToTypeID( "Ln  " ), propertyDesc );
    layerDesc.putObject( charIDToTypeID( "Usng" ), idcontentLayer, lineDesc );
    executeAction( charIDToTypeID( "Mk  " ), layerDesc, DialogModes.NO );
Is there any other way to do the above (using photoshop scripting method)?
Thanks,
AI

You can only create normal and text layers using the Object Model. For other layer types you have to use Action Manager.

Similar Messages

  • How to create a domain without using the root user in Sunone Server

    Hi,
    I am having one requirement to create a domain without using root user in sunone application server 8.1. Does any body know the solution?
    Message was edited by:
    SPBP

    Hi,
    If you are using file-based installation, you can install as non-root user and create domains as usual. You can use asadmin command available at <AS_INSTALL>/bin to do this.
    ex: ./asadmin create-domain domaindir /tmp/justfortest adminport 4850 --adminuser admin domain_nonroot_test
    Did you face any problem doing this in non-root. Unless you have write permissions in domaindir, you won't be facing any problem.
    Hope this clarifies your question.
    Thanks,
    -Balaji.

  • How to create a inputstream without using the file operation

    Hi friends
    In my application, I have to create a Streamsource object using the below constructor:
    public StreamSource(InputStream inputStream)
        Construct a StreamSource from a byte stream. Normally, a stream should be used rather than a reader, so the XML parser can resolve character encoding specified by the XML declaration.
        If this constructor is used to process a stylesheet, normally setSystemId should also be called, so that relative URI references can be resolved.
    Parameters:
        inputStream - A valid InputStream reference to an XML stream.*[http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/stream/StreamSource.html#StreamSource(java.io.InputStream) |http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/stream/StreamSource.html#StreamSource(java.io.InputStream) ]*
    But for creating the inputstream, i am creating a tempory file, ie I am using fileinputstream.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.StringReader;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    public class SourceConvertor
        private static Source convertStaxToStream(Source request)
    // here the argument to this method is StaxSource and the return type is StreamSource
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = null;
            File fp = null;
            FileInputStream fInp = null;
            try
                transformer = factory.newTransformer();
                fp = new File("tempFile.txt");
                transformer.transform(request, new StreamResult(fp));
                fInp = new FileInputStream(fp);
            } catch (Exception e)
                e.printStackTrace();
            return new StreamSource(fInp);
        public static void main(String args[])
            try
                String message ="<author><name>Rai</name><book>GodOfSmallThings</book></author>";
                Source original = new StreamSource(new StringReader(message));
                Source converted = convertStaxToStream(original);
                TransformerFactory factory = TransformerFactory.newInstance();
                Transformer transformer = factory.newTransformer();
                transformer.transform(converted, new StreamResult(System.out));
            catch (Exception e)
                // TODO Auto-generated catch block
                e.printStackTrace();
    This is not at all a good aproach because evey time it is creating a new file.
    So can anyone suggest a better aproach or idea or a simple code snippet so that i can create the inputstream without creating a temporary file.
    Thanks in advance:
    *[http://www.javamilestone.blogspot.com/  |http://www.javamilestone.blogspot.com/  ] *

    Err, a StreamSource is a Source. Check the Javadoc. You can pass it directly to the transform.

  • How to delete an AppointmentItem without using AppointmentItem.Delete() method?

    As per MSDN, we cannot use AppointmentItem.Delete() inside Close() event handler method of AppointmentItem. I need to find a way to delete this AppointmentItem (or preventing it from getting saved to Outlook calender). Please let me know if you have a way
    to do this.
    Thanks in advance.
    Prasad

    Hello Prasad,
    You can run a timer or use any other suitable event handler. In the timer' tick event handler you can get an instance of the AppointmentItem class by using the GetItemFromId method of the Namespace class. You just need to pass an entryId value which you
    may grab in the Close event handler.
    Be aware, you need to use the Timer class which uses the single thread for their events. You should access Outlook objects on the main thread only.

  • How to create RFC Destination without using SM59?

    Hello all:
    We are troubleshooting an issue.   An user created a RFC destination.   He claims that he did not use SM59.   We checked his access and do not have SM59 in his roles.
    He configured VIRSA FireFighter.   During the configuration, he created RFC destination.   Document says use SM59 or contact BASIS Admin.     He claims that he used a config table and he don't remember the config table name.   RFC screen shows his ID as creator of the RFC.
    We are trying to understand how an RFC can be created (outside of SM59) and plug the security hole in the environment.
    Any insights would be appreciated.
    --Anand

    The FireFighter solution changes the RFC destination of the service user "on the fly" without S_TCODE checks for 'SM59'. But if I can remember correctly when looking into this, it does not create the RFC destination (in SM59) "on the fly".
    > He claims that he used a config table and he don't remember the config table name.
    Theoretically this is possible - a config table to define the name of the destination, and then create it if it does not exist yet (when used).
    Otherwise, see SAP note 587410 and restrict (remove) his authority for the test environment (concentrate on S_DEVELOP, not S_TCODE - as you have also experienced).
    Cheers,
    Julius

  • Create a script to create multiple objects without using execute immediate.

    I have a function that requires several objects (4 types, 8 functions) to run. Right now they're in separate sql files. I'd like to combine them into one file that I would run but I'd rather not use the 'execute immediate' since it seems like you have to escape quotes and the like.
    How would you do that?
    Thanks in advance,
    J

    Yeah I thought about that but I'd like them all to be in one file.
    I believe I figured it out though. (about 20m after I posted no less)
    Adding a '/' on it's own line after each block of code appears to do the trick. I just have to write a bit of code to drop a dependent type if it exists.
    J

  • How to create arched text without using envelope warp in Illustrator?

    I am using Illustrator cs3 on mac os X This is a video of my problem that I sent to a fellow designer but didn't get an answer I was happy with. Can anyone help?
    http://www.screencast.com/t/4RePFrecwr

    The Appearance Panel is your friend. You don't need to duplicate items, simply add a new stroke to the existing object via the Appearance panel.
    To edit the contents of an Envelope Distort simply choose Object > Envelope Distort > Edit Contents. The preview bounding box will look odd, but you'll be able to select the text and apply any color to it.
    You could also expand the object using Object > Expand And ONLY check the "Object" box. This will result in outlines of the text where you can apply colors as well without the envelope getting in the way. But of course, it's no longer live text.

  • How to create window key without using the trillium option

    Hi,
    I am having some problems when trying to create using the window key generator module in ODI data quality.
    I created a business data parser for cleansing my records. This had to pass thru 4 routines, the transformer, parser, window key generator and the matcher routines. The transformer and parser routines have run properly but they window key generator is asking me to specify the window key.( I created the rules for the window key. Like last 3 consonants of last name and 5 digits of some ID). But this is not getting accepted when i am running it and pops an error message.
    I also do not have the trillium module integrated with ODI as of now.
    Can anyone help me with this problem or anyone has faced the same situation and have tried a work around for it.
    Please let me know.
    Thanks,
    Chapanna

    Hi,
    If you are using file-based installation, you can install as non-root user and create domains as usual. You can use asadmin command available at <AS_INSTALL>/bin to do this.
    ex: ./asadmin create-domain domaindir /tmp/justfortest adminport 4850 --adminuser admin domain_nonroot_test
    Did you face any problem doing this in non-root. Unless you have write permissions in domaindir, you won't be facing any problem.
    Hope this clarifies your question.
    Thanks,
    -Balaji.

  • How to create a new record using a custom method?

    Hi I want to create Jdev 11 a new record using the contructor following in the footsteps of http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtAnchor.CACCIJAG/vtTopicFile.adfdevguide%7Cweb_adv~htm/.
    My problem is the following.
    Messages for this page are listed below.
    Error
    JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    Error
    java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    Error
    Object: null is not a known entity type.
    Someone can help me?
    Cristian.

    Hello Frank, this tutorial make it and was successful but, what I am trying to do is add a new record in the table departments. The steps undertaken are suguientes
    drag over page the contructor department, with a submit, this will drag on the button, the method presistencia, set binding action with "$ (bindings.Departments.result)", and when running the application gives me the error
    Nov 2, 2007 10:06:22 PM oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ADFc: JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: javax.ejb.EJBException, msg=java.lang.IllegalArgumentException: Object: null is not a known entity type.; nested exception is: java.lang.IllegalArgumentException: Object: null is not a known entity type.
    I need to know if what I am doing is right, because I followed the steps of the tutorials and it is not functioning the insertion of a new record.
    Thank you thank you.

  • How do you create an array without using a shell on the FP?

    I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
    So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
    do not want to go that route.)

    Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
    I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
    If I seem a tad green... well I am.
    I hope you understand the LabVIEW environment and icons are still very new to me.
    Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
    e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
    "I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
    the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
    Attachments:
    Initialize_Settings.vi ‏55 KB
    Save_Settings.vi ‏52 KB

  • How to create an account without a credit card

    Does anyone know how to create an account without using a credit card?

    Yes.  Follow the instructions in this Apple support document.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    B-rock

  • How to create own interface without .cpp file?

    how to create own interface without using .cpp file ? To access the method inside the interface .
    e.g.  ILayoutTarget.
      Should not be SDKFileHelper.h because they are using SDKFileHelper.cpp file

    Rathan,
    PLz chk the below link (PDF file)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79?quicklink=index&overridelayout=true
    Mutti

  • HT2589 how can i create apple id without using credit card details ?

    how can i create apple id without using credit card details ?

    @Limnos - that doesn't work anymore. There is no NONE option. I've been at it for hours trying to set up my daughter's account. I've tried creating and verifying an appleID on the web, on her touch...everything. Every single time you get to the stupid Touch, it wants to walk you through the verification of the account and it demands payment (even for their suggested apple Remote method listed in the KB).

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • How to create a password file for executing psadmin command to deploy portl

    how to create a password file for executing psadmin command to deploy portlet

    What you have done is perfectly right. The password file doesn't have anything else apart from the password
    for example in your case
    $echo password > /tmp/password.txt
    However I remember that in windows install, the Application server used to wait for a user's input when a deploy was to be done for the first time. So Can you read the Release notes or the Readme file which has come with windows.
    The solution was,
    manually use asadmin command of application server to deploy some war (any webapp will do), at this time, a question will be prompted to accept a certificate. once this is done, deploy portlet should work fine!!!
    HTH

Maybe you are looking for

  • ITunes won't detect iPhone after iOS 7 Update

    Since I've updated to iOS 7, iTunes (11.1) won't detect my iPhone 5. Any advice..

  • PO Approval date

    Hi Experts, I have an issue with PO Approval date, we have a release strategy in place for all PRs > 5000 k INR, we have developed a costomised report where in we need to have the approval date of the PO ie the PO release date, we tried to consider t

  • Adding All Records In Report Parameter

    This is in addition to my previous post. I have this code as the source to a lov SELECT l.extkey||' - '||l.longdescr a, l.clocid b from udm_cloc l, udm_cust c, udm_lde lde where l.custid = c.custid and c.ldeid = lde.ldeid and lde.ldekey = :F140_LDEKE

  • Chinese characters misrepresented

    There are several Chinese characters misrepresented on my iPhone / iPod touch. For example: 骨,言,冷,胖 Funnily enough, when writing this post using a Firefox browser, the characters are equally misrepresented. When using Google Chrome, the above charact

  • To see my iPad's files on my Mac

    At Windows' case if I connect my ipad to Windows I have to use the WinSCP to see into my iPad's files. In case of MAC which how can i see into my iPad's files?