(UNSOLVED) Layer duplicated in another document

Hello, honorabe participants of the forum scripts Photoshop!

I have a problem - How to implement/action script duplication of the two layers related from one document to another document already open? The linked layers is a specially formatted text, so I can not just copy - paste the in the open document. Document already open is a CR2 file.

When I record the action, PS also save the receiver document name. But the name change when I open another folder so all acation jumps.

PS can record 'Select next 'document' and "Select previous document", but can't ' save 'duplicate layers in previous document ".

Please, help me to solve my problem.

Hey Borizzzed,

You try to run it on multiple files (ie: use this solution in a batch process)?  I do something very similar to the work; but I'm not sure of linked layers.  You will need to put them in a group for them to stay connected as I do.  In any case, the code I use is below:

#target photoshop

activeDoc var = app.activeDocument; This option stores the currently active document in the activeDoc variable

var originalDoc = app.documents.getByName ("source.psd"); This option stores your .psd source file name Photoshop may find the layers that you want to copy in the appropriate document.

var theLayer = originalDoc.layerSets.getByName ("text"); This option stores the group that you want to copy in the other document to a variable named theLayer

app.activeDocument = originalDoc //Switches to the active document to the document source for the duplication is possible only in the document further.

var theCopiedLayer = theLayer.duplicate (activeDoc, ElementPlacement.PLACEATBEGINNING);  This puts the Group at the top of the layer stack in the target document.

If you try to batch run this; just save the script in action and add a save option, then perform this action with the lot.  Also, if you are running it in the form of lots; don't forget that the source .psd is open before starting the batch job.  Anyway, give it a try and let me know if it works!

dgolberg

Tags: Photoshop

Similar Questions

  • Stretching / translating a layer into another document

    I have probably just my math, but given a limit of area of selection (or limits), I'm trying to resize it so that it is the size of a paper target, and then translate it so it is in the upper left corner, taking up the entire screen (so what is in the square selection occupies the entire screen.  Now if I duplicate the layer in the same document and resize it using the dimensions of the document and translate, it fills the entire screen.  However, if double layers in a target, document and scale and translate according to its dimensions, the layer is the right size, but madly out of position (most of the time off the page).  I think that the translation would be independent of the destination doc and based only on the magnitude and (minX, minY) from the selection box.

    Is my math off or y at - it something funny on duplicate a layer in another document?  I guess this is the first, but I continue to do it in my head and the math seems reasonable.

    var layer = app.activeDocument.activeLayer;
    layer.isBackgroundLayer = false;
    var layers = new Array (thumbnails.length);
    layers [0] = layer;
    for (var i = 0; i < layers.length; i ++) {}
    layers [i] = layer.duplicate (documentTarget);
    }

    var srcDocument = app.activeDocument;
    app.activeDocument = documentTarget;

    for each layer, through translation and resizing based on the size of the box
    for (var i = 0; i < layers.length; i ++) {}
    var selectionBox miniature = [i];


    var scaleX = documentTarget.width.as ("px") / (selectionBox ['maxX'] - selectionBox ["minX"]);
    var scaleY = documentTarget.height.as ("px") / (selectionBox ['Christmas'] - selectionBox ["minY"]);




    layers [i] .resize (scaleX * 100, scaleY * 100, AnchorPosition.TOPLEFT);
    layers [i] .translate (new UnitValue (-selectionBox ["minX"] * scaleX, 'px'),)
    new UnitValue (-selectionBox ["minY"] * scaleY, "px"));
    }





    }

    }

    .. Why would it be different if the layer is duplicated at the topleft of the paper target to 0,0 minX, minY?

    This is the point I was trying to do. This assumption is inaccurate. The duplicated layer is not 0,0 unless the two documents are the same size and resolution. To chip away at layer is centered in the new RFSO. Only when the sizes correspond to the positions will match. Otherwise the new top-left position could be anywhere including canvas (negative values).

    If you do not want to change the minX, minY, for some reason, you could add code to align the layer to the top left before the line translate.

    function align(type){
       var desc = new ActionDescriptor();
         var ref = new ActionReference();
           ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Lnkd" ));
       desc.putReference( charIDToTypeID( "null" ), ref);
       desc.putEnumerated( charIDToTypeID( "Usng" ),charIDToTypeID( "ADSt" ), charIDToTypeID( type ) );
       executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );;
    };
    function alignTopLeft(){
      align("AdTp");
      align("AdLf");
    };
    app.activeDocument.selection.selectAll();
    alignTopLeft();
    app.activeDocument.selection.deselect();
    
  • I just want to move a layer of document in Photoshop to another document that has a visible tab in the upper area

    I just want to move a layer of document in Photoshop to another document that has a visible tab in the upper area

    Ensuring that the layer is active, Ctrl (Cmd on Mac) + A to select all. CTRL (Cmd) + C to copy. Switch to the other document. CTRL (Cmd) + V to paste.

  • I place a psd file with transparent background on another layer in my InDesign document. The b layer

    I placed a psd file with a transparent background on another layer in my InDesign document. The layer below has a color (RGB). When the psd file is placed, it changes the color on the layer below. I tried other psd files thinking that something is wrong with my file, but get the same result. I tried for days to figure this. Can someone help me?

    Edition > space of merger of transparency... and the changes to the Document RGB

  • How and what is the keyboard shortcut for layer duplicated in a new tab? Thank you!

    How and what is the keyboard shortcut for layer duplicated in a new tab? Thank you!

    As an alternative to the suggestion of Chuck:

    Layer > duplicate layer. Document: new. Name the new file.

  • Copy the work plan (and art) to another document

    Is it possible to write a script to copy a graphic Board selected/chosen (and its contents) to another document open, placing exactly in the same place on the global x / y coordinates?  I am unable to find this feature in Illustrator, or it is simply missing.  Any help is greatly appreciated.

    Thank you!

    Tim

    Hi Tim, this is, open your model and your destination document and run the script

    #target illustrator
    
    // script.name = timLCdupArtboards.jsx;
    // script.description = duplicates provided artboards to another open document;
    // script.required = requires CS5, and both source and destination documenets (with the same layer structure) open
    // script.parent = CarlosCanto // 02/07/12;
    // script.elegant = false;
    
    // Notes: use only in documents with NO sublayers, 
    
    var docList = doclist(); // get a list of open docs
    
    var source = prompt ("Enter Source Document (Index Number)\r\r" + docList, 0, "Copy Artboards"); // get source doc name index
    if (source!=null) {// quit if pressed Cancel
        var dest = prompt ("Enter Destination Document (Index Number)\r\r" + docList, 1, "Copy Artboards"); // get destination doc name index
        if (dest!=null) {// quit if pressed Cancel
            var absstring = prompt ("Enter Indexes of Artboards to copy (comma separated)", "25,37,16,19,34,35,36", "Copy Artboards"); // get list of artboards to copy
            if (absstring!=null) {// quit if pressed Cancel
    
                var artbs = absstring.split (","); // turn list into an array
                var absCount = artbs.length; // get artboards count
    
                var sourceDoc = app.documents[source]; // get actual docs
                var destDoc = app.documents[dest];
    
                // get layer visible/lock info & unlock and make visible all layers
                var sourceDocLayerState = unlockUnhideLayers(sourceDoc);
                var destDocLayerState = unlockUnhideLayers(destDoc);
    
                sourceDoc.activate(); // activate source otherwise it is not able to access selection
    
                var ABs = []; // array to hold of artboard objects to copy
                var ABsRect = []; // array to hold artboards Rectangles
                var ABsNames = []; // array to hold artboard names
                var ABsInfo = []; // array to hold [Rect, Names]
                for (i=0; i		   
  • Move or copy smartobject in another document

    I have a layer of smartobject with a layer mask that I want to move to another document using a script.

    Is this possible? If so, how? Otherwise, what is the best solution?

    In the following search http://forums.adobe.com/thread/873935?tstart=0 wire Michael L Hale attached function dupeActiveLayerToDocument()

    Note the dependence of the order of the document in the round of open documents in Photoshop...

  • cpy/paiste group in another document

    Hello forumers.

    Im trying to copy/paiste my group (of 10layers) of a document of ps in another.is it possible?
    IM by selecting all its paisting in my another document, but all the layers are merged.i need to come into the document as a group with all its layers.

    Thank you.

    Select the Group and choose layer > Group duplicate... and duplicate the document you want in the group. Otherwise, you can drag and drop one document to another group using the move tool.

  • When I clik on a link to view another Web page or another document, a blank page appears (a single "point of png'). How can I solve this issue?

    The links are located on the emails I receive from authorized sources. When I click on the links to read the additional documents (another document) or display a picture, I get a blank page with a single point in the middle of the page. The tab header says it's an image (1 x 1 pixel) PNG. Any suggestions to fix this?

    Often, links to email in bulk are routed via a follow-up rather than service directly to its final destination. If you look at the address bar on the image page, it seems like one of these intermediaries rather than the page you expect to load? If you click on the address bar and press ENTER to retry the address, which does nothing?

    It is possible that the security software or security add-on kills a redirect from this intermediate page to the final destination. For example, I think the anti-banner Kaspersky functionality could do that.

  • When I m I look at an image or another document, after a time (short term) the screen go to the home page, how can I change the time if I don't have this problem?

    When I m I look at an image or another document, after a time (short term) the screen go to the home page, how can I change the time if I don't have this problem

    Hi, Romulo,

    This question should be validated in the Internet Explorer Forum.  Note the drop-down menus.

    http://answers.Microsoft.com/en-us/IE/Forum

    What sites you encounter the problem with?

    Make sure flash player is the current version

    http://www.Adobe.com/software/Flash/about/

    Check Shockwave player is the current version

    http://www.Adobe.com/Shockwave/welcome/

    Check the Java version

    http://Java.com/en/download/installed.jsp

    You check the internet connection

    If you are experiencing network connectivity problems in Internet Explorer, the first thing to do is to make sure that all cables are connected. Then open Network Diagnostics by right-clicking the network icon in the notification area, and then click diagnose and repair (if you use Windows Vista) or solve problems (if you use Windows 7).

    If the problem persists, see the following articles:

  • While trying to access another document, I get this "error in the object calling ScriptTypeError not valid."

    Original title: error

    I work in the database search.  In a particular site while trying to access another document, I get this... Error in the object of the invalid ScriptTypeError call.

    How can I fix it?  I be milling of the answers, I went to frequently asked questions, found no answers. I hope someone can help.

    Thank you

    pipster43

    Hi Pipster43,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for Windows Server on TechNet forum. Please ask your question in the Forums in TechNet Windows Server.

  • 'Create page vew' in another document, both documents are open

    In Adobe Acrobat 9 Pro, I want to create a link in the document 1 page view display a passage in 2, but after I created the link to the page, when you click on closing the document 1 link (the same thing happens in 10 Pro).

    This does not happen when I create a link "open a file", which translates the two files remain open (Yes, I select 'new window' which documents link).

    The only steps that I can see to follow are 'create link'-> select the page in the current or other document - to go to a Page view popup menu menu 'fixed '. After I do that the link is created, but when you click on the current document closes.

    Can I change the settings by default so that I can keep two open documents?

    It is possible to do it, Yes, but unfortunately only after you have created the link.

    Right click on the link (using Add or change the link), and then select Properties. Switch to the Actions tab and change the action "Go to a page in another document" which is there. Under 'Open In' select 'New window', and then click OK.

    Another thing you can do is to go to editing Documents - Preferences - and uncheck "open the cross-documents links in the same window.

    This means that if the link is configured to use the preferences of the user, the file will open in a new window. But if the link is set to open in the same window, it will not make a difference.

  • Signature is removed when the document is attached to another document, how can I keep the signature?

    I lost the signature of the writer when I attach a document to another document, how to restore keeping the signature.  He used to work until I did something to remove the signature.

    Example:

    I have a letter of transmittal from pdf to the contractor.  And I want to join two transmission of the Consultant as an attachment for approval of letter: 6 to 3 000 lb/po2 of concrete and 6 b to 4 000 lb/po2 of concrete. Both have been signed by the consultant approved by using the electronic signature.

    When I join these two documents, the signature does not, the signature block is white.

    It used to work until I did something (my finger must have done something) and now the signature does not appear.

    How to get back my original back where I could attach a document with the electronic signature.

    Edward Masuoka

    -

  • Why delete Adobe link action "go to a page in another document"?

    When you bind documents, you used to be able to link to another document and Adobe say what page to open.  Example: I want the document has a link to document B, but I want to document B to open the Page 2 instead of 1.  That option no longer exists under Actions, run menu option.  He was very helpful and I love him back.

    Read my instructions more carefully. When you add the action "Go to a page view" and you see the window floating in my answer above, then you must open the file you want to link to, navigate to the point that you want to link to and then click on"link" in this floating window.

    You should not add a separate order "open a file" because this is not going to work.

  • [JS] [Win7] [CS5] Moving pages to another document

    Hi guys,.

    I need to write a script for my company that merges the 3 documents together by selecting the needed pages in two of the three documents and moving them to the third document. Everything works fine and I have almost finished, but I can't find a way to move pages between documents.

    I also thought to simply copy everything on the necessary pages, but it does not work because each document has pages masters that are needed.

    Is anyone able to help me with the code necessary to select some Pages and move them to the end of another document?

    Any help would be greatly appreciated.

    Statixx91

    Statixx91 wrote:

    ...

    Everything works fine and I have almost finished, but I can't find a way to move pages between documents. I also thought to simply copy everything on the necessary pages, but it does not work because each document has pages masters that are needed.

    ...

    With no page moved and no pageItems covered - where is the point you called 'almost finished '?

    Example:

    (with 2 documents open - was last opened index = 0)

    var tarPage = app.documents[0].pages[0];
    app.documents[1].pages[0].duplicate(LocationOptions.AFTER, tarPage);
    

    It does double duty with 1st page of the 1st doc after 1st page od 2nd doc. similar work Move() method.

    In the case of masterPages you can move, but it's an open door to another story, I'm afraid.

    Jarek

Maybe you are looking for