Create new layer after active layer

Using scriptlistener I can create a new layer called "newlayer" after the active layer. So far so good.
  var id197 = charIDToTypeID( "Mk  " );
  var desc49 = new ActionDescriptor();
  var id198 = charIDToTypeID( "null" );
  var ref41 = new ActionReference();
  var id199 = charIDToTypeID( "Lyr " );
  ref41.putClass( id199 );
  desc49.putReference( id198, ref41 );
  var id200 = charIDToTypeID( "Usng" );
  var desc50 = new ActionDescriptor();
  var id201 = charIDToTypeID( "Nm  " );
  desc50.putString( id201, "newlayer" );
  var id202 = charIDToTypeID( "Lyr " );
  desc49.putObject( id200, id202, desc50 );
  executeAction( id197, desc49, DialogModes.NO );
However, without the script listener we have
  var layerRef = app.activeDocument.artLayers.add()
  layerRef.name = newlayername
  layerRef.blendMode = BlendMode.NORMAL
  // Move the new layer after the current layer
  layerRef.moveAfter(app.activeDocument.artLayers[layerIndex])
The moveAfter command needs an index, which would mean looping though all the layers till to find the active layer (since we can't access that throughthe DOM). This seems a bit long winded to me. Or am I missing a trick here?

Well I would just use the scriptlistener code but if you don't want to for some reason you should make a reference to the activeLayer before add the new layer. Then use that reference as the moveAfter argument. The moveAfter method needs a layer object not a layer index. You need the index only because you are trying to supply that layer object by index.
layerRef.moveAfter(someLayerRef);
Also ( not that it really matters ) when scripting was first added there were several methods for moving a layer, moveAfter() was one of those. Those methods were combined into one method and the old methods are no longer documented in the javascript reference. So below is the documented way to move the layer.
layerRef.move(someLayerRef, ElementPlacement.PLACEAFTER);

Similar Messages

  • Problem with "Create New Extrusion from Selected Layer" CC 2014

    Hello, I'm experienced with Photoshop but am new to 3D text in Photoshop.  I type in some text and convert to a shape.  When I choose Create New Extrusion from Selected Layer I get  dialog box I don't see in any tutorials.  It says "You are about to create a 3D layer.  Would you like to switch to the 3D workspace?  Yes/No, Don't show again."  Which should I use for 3D text? 
    If I choose Yes, all the panels go away and the content in the tool options bar (ribbon?) just under the menu bar go away.  I have to restart Photoshop to get the tool options back.  What could I be doing wrong?
    Thanks - Dave

    I just chose "No" and didn't look back.  I like my workspace just as it is, and don't prefer Photoshop to change it for me under this particular case.
    You can make the 3D panel visible yourself via Window - 3D.  I find it's a good alternate for the Actions panel, as I don't have any actions at the moment that work in the 3D world.
    The panels you'll want to see easily if you work on 3D are the 3D panel and the Properties panel, among a few others.
    Regarding getting your workspace back the way you like it...  Note the little selector near the upper-right corner of the Photoshop main window.  That can be used to select a workspace.  I suggest you experiment and get familiar with the concept of workspaces.  You can define your own and save it with a name, and that truly can be helpful.
    -Noel

  • Alt + Create new Fill or Adjustment Layer CC2014

    Alt + Create new Fill or Adjustment Layer Photoshop CC2014 not working
    In Photoshop CS6 I can click on the Alt key and select Create new Fill or Adjustment Layer to create a new adjustment layer with options, but when I try the same in Photoshop CC2014 clicking the Alt doesn't work that way, is there something that I'm doing wrong or maybe there's another shortcut key that I'm unaware of. Is there another way to do the same thing as CS6
    System Spec
    Windows Pro 8.1
    16 GB RAM
    300 GB Scratch Disk
    2GB Graphics Card
    Everything up to date

    It also work in Photoshop CC like in CS6 but not in CC 2014 it seem to be a bug.

  • [syntax_error] in Creating New User - After applying SP ABAP & Basis lv 8

    Hi Gurus.
    actually I already created message to SAP regarding this. but i havent receieve any respond. I post here just in case maybe I can have immediate solution from you guys..
    I have 2 system HLC and MFG
    which is using same OS and DB
    DB Information
    DB client lib.     SQL_Server_8.00
    DB releases        MSSQL 7.00.699 or higher, MSSQL 8.00.194
    DBSL version       700.08
    DBSL Patch Level   144
    System Information
    SAP versions       700
    Operating System   Windows NT 5.0, Windows NT 5.1, Windows NT 5.2, Wi
    OP release         5.2
    which have same Kernel and SP patches
    Kernel release    700
    Sup.Pkg lvl.      146
    SAP_ABA     700     0008     SAPKA70008
    SAP_BASIS     700     0008     SAPKB70008
    ST-PI 2005_1_700     0006     SAPKITLQI6
    PI_BASIS     2005_1_700     0005     SAPKIPYJ75
    Problem
    previously both of the system HLC and MFG is in level 6 SP ABAP and BASIS
    when i try to create EWA report for both of them, i have missing module in the report
    and i read a note that i need to upgrade to level 8.
    when i upgrade both of them to level 7, then i run sgen and there are no problem on both system
    but when i upgrade both of them to level 8
    in my MFG system, i can run sgen with no problem.
    in my HLC system, i run sgen and it take a long time to validate the programs which are need to be recompiled. so i never run sgen to recompile on HLC system after i update the SP to level 8. but i believe this shouldnt be an issue.
    the day after i update the SP, one of my user raise an issue.
    (same issue is not happened in MFG system only in HLC system)
    when we try to create new user..
    SU01 -> create new user -> fill all the details -> save -> abap dumps
      Error in the ABAP Application Program
      The current ABAP program "/SAPSLL/CL_IM_BP_ADDRESS======CP" had to be
       terminated because it has
      come across a statement that unfortunately cannot be executed.
      The following syntax error occurred in program "/SAPSLL/SAPLBP_ADDRESS " in
       include "/SAPSLL/LBP_ADDRESSTOP " in
      line 22:
      "Statement "/SAPSLL/DEBUG_DATA" is not defined. Check your spelling . ."
      The include has been created and last changed by:
      Created by: "SAP "
      Last changed by: "SAP "

    Hi all
    problem is solved..
    after doing some debugging, we found out
    there are some missing entries in table TRMAC
    so i just copy the missing entries from my MFG server to HLC server since they are both in same condition.
    now i am wondering why do the support package miss to enter the rows in TRMAC table >.<
    SAPache man..

  • Need Help creating new user in Active Directory

    I am trying to create a new user in active directory via a java application. I have included the code that I am using. I am able to successfully bind to Active Directory. I have been able to change passwords, and delete users, but I have not been able to create a user.
    ldapHost : "mta101.DOM101.CEL.ACC.AF.MIL"
    domainName: "dc=dom101,dc=cel,dc=acc,dc=af,dc=mil"
    existing account: CN=Brett K. Humpherys,OU=Users,OU=CEL
    I get the following error on the createSubcontext statement:
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - 00000057: LdapErr: DSID-0C09098B, comment: Error in attribute conversion operation, data 0, v893 ; remaining name 'CN=test1,OU=Users,OU=CEL'
    I have commented out the password portion and change the ObjectCategory to a 32 and get the same error.
        public GblStatus createAccount7(DbaDb dbConn,
                                        String jsrcName,
                                        String personName,
                                        String username,
                                        String password)
          Hashtable ldapEnv = new Hashtable(11);
          ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
          ldapEnv.put(Context.PROVIDER_URL, "ldap://" + this.ldapHost + ":636");
          ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
          ldapEnv.put(Context.SECURITY_PROTOCOL, "ssl");
          ldapEnv.put(Context.REFERRAL, "ignore");
          ldapEnv.put(Context.SECURITY_PRINCIPAL,"cn=" + this.adminAcct + ",cn=users," + this.domainName);
          ldapEnv.put(Context.SECURITY_CREDENTIALS, this.adminPwd);
           try
            // Create the initial context
            DirContext ctx = new InitialDirContext(ldapEnv);
            BasicAttributes attrs = new BasicAttributes();
            BasicAttribute ocs = new BasicAttribute("objectclass");
            ocs.add("top");
            ocs.add("person");
            ocs.add("organizationalPerson");
            ocs.add("user");
            attrs.put(ocs);
            BasicAttribute gn = new BasicAttribute("givenName", "test1");
            attrs.put(gn);
            BasicAttribute sn = new BasicAttribute("sn", "");
            attrs.put(sn);
            BasicAttribute cn = new BasicAttribute("cn", "test1");
            attrs.put(cn);
            BasicAttribute uac = new BasicAttribute("userAccountControl", "66048");
            attrs.put(uac);
            BasicAttribute sam = new BasicAttribute("sAMAccountName", "test1");
            attrs.put(sam);
            BasicAttribute disName = new BasicAttribute("displayName", "test1");
            attrs.put(disName);
            BasicAttribute userPrincipalName = new BasicAttribute
                                          ("userPrincipalName", "[email protected]");
            attrs.put(userPrincipalName);
            BasicAttribute instanceType = new BasicAttribute("instanceType", "4");
            attrs.put(instanceType);
            BasicAttribute objectCategory = new BasicAttribute
                      ("objectCategory","CN=User,CN=Schema,CN=Configuration," + domainName);
            attrs.put(objectCategory);
            String newVal = new String("\"password\"");
            byte _bytes[] = newVal.getBytes("Unicode");
    byte bytes[] = new byte[_bytes.length - 2];
    System.arraycopy(_bytes, 2, bytes, 0, _bytes.length - 2);
    BasicAttribute attribute = new BasicAttribute("unicodePwd");
    attribute.add((byte[]) bytes);
    attrs.put(attribute);
    ctx.createSubcontext("CN=test1,OU=Users,OU=CEL", attrs);
    ctx.close();
    catch (NameAlreadyBoundException nex)
    System.out.println("User ID is already in use, please select a different user ID ...");
    catch (Exception ex)
    System.out.println("Failed to create user account... Please verify the user information...");
    ex.printStackTrace();
    return new GblStatus();
    Any help would be much appreciated.

    Hi .,
    me too got up with same problem., can anyone help me.??
    Someone help me to create attributes in AD using LDAP
    package LDAPpack;
    import javax.naming.*;
    import javax.naming.directory.*;
    import javax.naming.ldap.InitialLdapContext;
    import javax.naming.ldap.LdapContext;
    import java.util.Hashtable;
    class CreateAttrs {
    public static void main(String[] args) {
         Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, "ldap://10.242.6.166:389/");
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL, "CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
                        env.put(Context.SECURITY_CREDENTIALS, "password-1");
              LdapContext ctx =null;
              try {
                   //ctx = new InitialLdapContext(env,null);
                   try {
    ctx = new InitialLdapContext(env,null);
                   catch(NamingException e) {
    System.out.println("Login failed");
    System.exit(0);
    if(ctx!=null){              
    System.out.println("Login Successful");
    byte[] buf = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; // same data
         // Create a multivalued attribute with 4 String values
         BasicAttribute oc = new BasicAttribute("objectClassNew", "topNew");
         oc.add("personNew");
         oc.add("organizationalPersonNew");
         // Create an attribute with a byte array
         BasicAttribute photo = new BasicAttribute("jpegPhotoNew", buf);
         // Create attribute set
         BasicAttributes attrs = new BasicAttributes(true);
         attrs.put(oc);
         attrs.put(photo);
         Attributes attrs1 = ctx.getAttributes("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
    System.out.println(attrs1);
    Context result = ctx.createSubcontext("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org", attrs);
    //i got error here; i attach the error below.
         ctx.close();
    System.out.println("close");
         catch(NamingException e){
              e.printStackTrace();
    ERROR:
    Login Successful
    javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece
    ANYONE HELP ME PLS.
    Edited by: vencer on Jun 19, 2008 12:38 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Create new transaction (Business Activity) and assigned to user Problem

    Dear sir,
    We already have the business activity with in T-code : CIC0, The transaction is  ZACT1 and assigned to user group1 .  It's working fine. However when I copy something from transaction ZACT1 and create to be T-code : ZACT2 . and assigned user group2.  There is the problem that when log on to CIC0 . It is the authorization from for transaction ZACT1.  WHen I go to su53
    it need to have the authoriazaiton on Business transaction type: ZACT1
    Please kindly advise.
    Thank you and best regards,
    Vimol

    When you create new transaction variant, original transaction remains as it is. During creation of transaction variant, when you go to one by one screen, screen variants are created. It uses variant name and can be see on each screen on the top.
    Once you complete trasnaction, you start using this transaction variant instead of original transaction. In SHD0, there is button on the top 'assign screen variants' which allows you to assign all screen variants created above. You can refer help file which i think has procedure to do this.

  • Creating new databases after latest security patch applied

    10.2.0.4
    If I create a database AFTEr applying the opatch for the October 2009 security patch, do I need to also run:
    @catbundle.sql cpu apply
    Or is it included in the create database? I use the DBCA to create new databases.

    user8574962 wrote:
    This is what Oracle states on metalink doc id: 422303.1
    Once the bundle patch or the Critical Patch Update (CPU) patch is applied on an ORACLE_HOME should you run post-installation scripts for every newly created Oracle database using the same ORACLE_HOME?
    Solution
    This should be documented in the patch's README as the answer will vary with each patch.
    If the patch's README is not documented, then the Post Install tasks should be run.
    And this is what the OCTCPU09 README says:
    3.3.3 Post Installation Instructions for Databases Created or Upgraded after Installation of CPUOct2009 in the Oracle Home
    These instructions are for both non-RAC environments and RAC environments when a database is created or upgraded after the installation of CPUOct2009.
    You must execute the steps in Section 3.3.2.1, "Loading Modified .sql Files into the Database" for any new database only if it was created by any of the following methods:
    Using DBCA (Database Configuration Assistant) to select a sample database (General, Data Warehouse, Transaction Processing)
    Using a script that was created by DBCA that creates a database from a sample database
    Hope that helps.Point taken that it could vary by patchset, but those particular instructions quoted square exactly with what I had said. To quote with emphasis:
    "You must execute the steps . . . for any new database *only if* it was created by any of the following methods . . ."
    And what are those methods? Creating the database from a sample (pre-patch) database. If one uses dbca to create a 'custom' database, the resulting scripts will start from scratch with a CREATE DATABASE command - no pre-patch version sample or seed database involved.
    :-)

  • Do we have to create new tranformations after BI 7 upgrade?

    Hi All,
    Recently we upgraded from 3.5 to BI7, for the datamarts, I created the transformations and DTPs from the update rules (by converting). And for Master Data, there tons of InfoObjects are there to do like that and with lots of routines. Should I have to create new transformations and DTPs for all them from the scratch or is there any way to make use of it? Need your suggestions. Thanks!!
    ~ V

    1. Activate 3x  dataflow objects
    2. Run existing process chains to load data just to make sure you can load data in new environment using rsa1old.
    3. Convert 3x dataflow objects to BI 7x ( Create transformation by selecting Create Transformatyion Option from the context menu of the Transfer rule, then from Update rule. The TR/ UR is copied to the newly created BI 7.x infosource. Confirm that UR is copied successfully and new transformation is saved.) Activate your transformation
    4. Migrate existing datasource to generate a new datasource.
    5. Datasource tree will show dataflow after migration.
    BW 3x objects will show with small squares and can be deleted after migration.
    6. Create DTP and test the load manually.
    For process chain - have to include DTP in each process chain. You are not replacing infopackages. Infopackage will load data till PSA and DTP will load data from psa to targets.
    Hope this helps..

  • Material created from Nwbc, after activation it is visible in ECC mm03, but cannot be viewed in nwbc display material

    Dear  Freinds,
    We are creating a Material from Nwbc, after activation and workflow approval it is visible in ECC mm03, But cannot be viewed in nwbc display material.
    There is some configuration mistake or technical issue?
    Regards
    Sukumar

    Dear Sukumar,
    MDG Material search is based on Enterprise search. Pls check if the ES at MDG system is configured correctly and is working fine with all connectors in "active" status.
    Regards, JVR

  • Can't create new files after moving to ext drive, LR4

    I moved all photos to a new ext drive (they used to be on the c drive); reformatted my desktop computer; reinstalled LR4. 
    Now there is no parent file under the name of the ext drive on which I can right click and "create a folder inside....".  I am able to create new folders in the existing subfolders.
    There is also no way to sync the drive to find a new folder I created via Windows explorer.
    My filing system is by month and year so now with each passing month I am not able to set up a new file.
    Help!

    Can you right-click on a folder name in the Lightroom Folder Panel and select "Show Parent Folder"?
    Can you import new photos directly to the desired folder in the desired location?

  • Automatically create new slide after pasting large block of text?

    Hello,
    Does anyone know if it is possible to have Keynote automatically create new slides if I paste text that doesn't fit into a single slide? The biggest time waster I've encountered is the apparent requirement to break up large chunks of text manually.
    If Keynote does not do this, any ideas as to an Applescript or something that could help?
    Much appreciated

    I usually try dragging from the bottom up in Web pages, it can be tricky getting at the part you want without the extraneous formatting, since that is concealed from you and web designers use many different methods for layout.
    That's why pasting into a plain text document is a good idea to shake off the web formatting, otherwise you are groping around whatever Pages has interpreted the formatting to mean. Even browsers don't get this all right.
    If the original was formatted as a table which won't fit one of the cells on a Pages page, it just pops and won't continue because Pages does not allow breaks in mid cell. If the cells are small enough to fit and you have pasted the table inline in the main text body of a WP file (between the margins) it will flow.
    Peter

  • Third party SO creating new PR after rejection is removed...

    Hi ,
    Sometimes due some user mistake, rejection is set in SO & this deletes the corresponding third party PR. But third party PO is already created w.r.t this PR . Now if user removes the rejection in SO, it creates a new third Party PR or new item in the same PR.
    this make it necessary to delete the old third party PO & create new PO w.r.t the new PR. So i wanted to know if there is a way when rejection is removed from SO, it does not create a new PR but it simply undelete the earlier third party PR?
    Thanks for your help.
    Regards,
    Anubhab

    Thanks for sharing the info.
    Check IMG - SD - Basic Function - TOR for Maintain Requirements For Purchase And Assembly Orders
    Still I really suspect, whether that will be able to help you. As per my experience, if your all info / determination are correct, it will automatically create PR in background on same. So, this initially avoid determination of plant (standard way). but it created lot of confusion, so we used exit.
    I would still suggest, to keep it simple, use exit for you requirement
    Thanks & Regards
    JP

  • Can't create new users after GroupWise is moved from NetWare to Linux

    Hi,
    I moved GroupWise (Version 6.5 SP 6, single domain and single office)
    from NetWare 6.5 server to SUSE Linux Enterprise server 9. It seems the
    GroupWise server is running oaky. Existing users are able to connect
    their mail box and send and receive messages. But I can't create new
    users on the GroupWise server.
    I used ConsoleOne installed on the Linux server to create new GroupWise
    users. It seemed that I was able to do it. The new users appear on the
    NDS and the GroupWise File IDs were assigned for these users. And I was
    able to add these new users to distribution lists. But the users DB
    files (userXXX.db) were not created under /grpwise/po/ofuser on the Linux
    server and they cannot connect to the server. Old users cannot find them
    in Novell GroupWise Address book.
    Does anyone how to fix the problem?
    Thanks in advance!
    Jinkang

    Hi,
    [email protected] wrote:
    >
    > Hi,
    >
    > I moved GroupWise (Version 6.5 SP 6, single domain and single office)
    > from NetWare 6.5 server to SUSE Linux Enterprise server 9. It seems the
    > GroupWise server is running oaky. Existing users are able to connect
    > their mail box and send and receive messages. But I can't create new
    > users on the GroupWise server.
    >
    > I used ConsoleOne installed on the Linux server to create new GroupWise
    > users. It seemed that I was able to do it. The new users appear on the
    > NDS and the GroupWise File IDs were assigned for these users. And I was
    > able to add these new users to distribution lists. But the users DB
    > files (userXXX.db) were not created under /grpwise/po/ofuser on the Linux
    > server and they cannot connect to the server. Old users cannot find them
    > in Novell GroupWise Address book.
    >
    > Does anyone how to fix the problem?
    This clearly sounds like your domain (which is the part of groupwise
    which you admin against) doesn't/can't talk to the postoffice, so the
    change you made (to the domain) does never get to the PO (which is where
    the addressbook of your other users come from, and is what is
    responsible for creating the user DB). This seems very likely to be
    caused by your move not being done properly, and old information (either
    path or IP address) for the PO still being in the domain and/or domain
    database.
    So how's the domain linked to the PO?
    CU,
    Massimo Rosen
    Novell Product Support Forum Sysop
    No emails please!
    http://www.cfc-it.de

  • Can't open existing/create new files after reinstall

    I had the trial version installed to test the software and everything was running fine until I started having some issues with my computer. So I ended up reinstalling the trial version and now I can't open existing XLF files or create new ones. Both the "new" and "open" icons are now grayed out.

    Hi,
    Issuess if Opne and new are grayed out..
    Make sure you take a fresh copy of Xcelisu and reinstall the entire application again.
    If any other issuess please let me know i am happy to help you...

  • Problems with Creating New Users after migration to EOP

    My company uses EOP only for spam email protection as we have an on premise Exchange 2010 server.  The issue I am having is after I manually create a new user through the Office 365 Admin Center they do not show up as a user in the Exchange Admin Center
    part of EOP. Please let me know if any additional information is needed.

    Hi,
    Thank you for your post here.
    Please firstly double check your configuration as the follow article.
    http://technet.microsoft.com/en-us/library/office-365-user-account-management.aspx
    Best Regards
    Quan Gu

Maybe you are looking for