How to move a layer to a X/Y position with VB/DOM ??

Hello,
I try to move a layer on a picture to a position X/Y. Up to now, I'm only able to move for a relative mouvement from initial position, but I would like a move with the corner of the picture as reference.
The need : To place on the doc1 (big doc) a small picture (doc2). I use copy/paste to have the small picture as a new layer on the big picture
I use VBA-excel to open Photoshop and run the differents step.
What I suceed to do :
PS = CreateObject("Photoshop.Application")       ' Launch PS : OK
'Open the 2 doc (doc1 : big picture, doc2 : small picture) : OK
'go on the small picture and select/copy the picture : OK
PS.activedocument = PS.documents(2)
PS.Documents(2).selection.selectall
PS.Documents(2).selection.copy
'go on the big picture and paste as a new layer : OK
PS.activedocument = PS.documents(1)
ps.documents(1).paste
'find the information about the new layer : HERE IS THE PROBLEM
'move the layer in the correct position after compute the need move : OK
ps.document(1).translate 20,20
I found this information for another script language
>var currentBounds = targetDoc.activeLayer.bounds;// get the bounds of the layer - which is the activeLayer of the targetDoc
>var offsetX = new UnitValue( newX-currentBounds[0].as('px'), 'px');// the required offset needed for move
So I think it's possible to get the bound of the mayer, but I don't know how to write it in VB
The other solution is to find a "translate" method which use the destination point x/y without using initial position (absolute coordinate), but i don't find this kind of method.
Thank's for any help

Hi again,
Thanks for the reply...
Mads wrote in news:506500000005000000A6110100-1042324653000
@exchange.ni.com:
> It a "Current VI's path constant", you can find it on the file palette
> under constants. It'n not really constant as it will always give the
> path of the VI it's in...a useful reference.
Oh, it's not what I'm looking for then I've got a complex script parser
which is fully multitasking and re-entrant so I can run multiple scripts in
parallel. (The scripting languauge is just a high level access to some
functions of my program so that non-LVers can still have a degree of
programmability)
Currently every time I call my re-entrant SubVI I have to pass it its own
VI Reference from the Open VI Refere
nce with "prepare for re-entrant" bit
set.
Is there an equivalent constant anywhere "Current VI's VI Reference"? Of
course I can't reference by path, as I can have 20 of the same VI running,
all with their own Reference and execution space. It gets very messy when
my VI calls itself, or I have to pass the reference to other places.
Thanks again,
Andrew

Similar Messages

  • How to move track layer in timeline so all keyframes move together?

    Hi all,
    I have a simple project with various text layers moving up from the bottom and gently landing in position. There is also a style face blur going on so the text starts out blurred and becomes clear as the text lands. As I duplicate a layer in the group for a new line of text, then slide the new layer downstream a bit, the blur keyframes don't move to the layer's new position. They stay in the original position. Anyone know how to lock these keyframe to the original layer?
    Thanks much, Reed

    There's quite a bit of strange behavior with text I'm noticing as I was trying to figure out a workaround.
    Using the gaussian blur filter didn't work as it should. It works fine on the base layer but when you duplicate the text layer with the blur, it's visibly cropped for no reason (crop is not checked, and the fixed resolution changes nothing). It's as if the act of duplicating a text layer breaks the gaussian blur filter. The only solution was to delete the filter and reapply.
    I also tried using a Ramp behavior to adjust the face blur in the Styles tab. Once again it worked fine on the initial layer. But when I duplicated the text layer, the duplicate Ramp behavior was there, but lost it's connection to the parameter it was applied to. I had to reattach it.
    Definitely some strangeness there. Also, if you animate the blur with keyframes as the OP did, and then duplicate the layer, the copy will have keyframes in that parameter, but not at that point (even if you haven't repositioned the layer). If you then select Previous Keyframe from the animation menu of the duplicate, the playhead disappears from the GUI. That's definitely in bug territory.
    Andy

  • How to move files from external drive to main drive WITH keywords?

    On a recent trip, I uploaded several thousand images onto an external hardrive that I was using with my laptop.I keyworded and edited these files while on the road.
    Back home, I want to move the files (keywords and all) to my permanent LR library which resides on a different hard drive. How can I make this transfer without losing keywords?
    Thank you in advance.

    Hi Jessica,
    There seems to be a confusion of terms here: the catalog is where LR stores all its information (what your referred to as LR's library in your original post).
    While you were on the road, did you use LR to add keywords to the photos, or did you use some other tool? If you used LR, than you already have a catalog on the laptop, which you can then import into your main LR catalog (using the Import from Catalog option from the File menu). Let us know if you get stuck anywhere.
    Marc

  • How to move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

  • How to move a folder from one drive to another with out copying it.

    j want to move a large folder with video from my hard drive to an external hard drive but with having to copy it.

    Hold a command (⌘) key while dragging the folder.

  • How to move the dock from one display to another with multiple monitors?

    Sometimes the dock will switch from one monitor to another just by clicking in the dock area of the second montor. Other times it does not.

    I found out that I have to keep moving downward on my trackpad after the cursor hits the bottom of the screen. It works now.

  • How to move entire catalog and collection from old PC with PSE 4 to new PC with PSE 9

    I have read various answers regarding upgrading to new PC's using newer versions of PSE
    . All solutions seem to differ slightly. Can anyone give me a good path to follow for upgrading from PSE 4 on old windows XP PC to PSE 9 on a new Win 7 PC
    Any help would be greatly appreciated

    I did it like this:
    copy all your photos from your old PC to exactly the same folder in your new PC.
    Install the trial version of PSE9 to your new PC. Copy the old catalog from your old PC to your new PC. In the new PC choose File/Catalog/Convert/Find more catalogs, locate the folder where you copied the catalog, choose Convert. And there it is! Everythingworks beautifully!
    Of course I'm not 100 % sure was it exactly like this what I did just half an hour ago. But I had exactly the same problem as you: PSE4+old PC --> New PSE + new PC (I wanted to have all the old tags to be in use also in the new PC and new version of PSE9).
    Some more advice: to locate the catalog in your old PC: start PSE4, choose File/Catalog/New and you'll see on the screen the folder where old catalog is located (in my PC it was: c:\Documents and Settings\All  Users\Application Data\Adobe\Catalogs - file named "My catalog.psa").
    Good luck,
    MattiS

  • How to move Content from Quality to Production Server

    Hi
    We are havng EP6 SP13.
    How to move the Content from one Server to another
    With Regard's
    Sri

    Hi ,
    Check out this link
    http://help.sap.com/saphelp_nw04/helpdata/en/91/4931eca9ef05449bfe272289d20b37/frameset.htm
    This explains how to move PCD objects by creating a transport package.
    Ankur
    P.S. Reward points if this helps

  • I have several layers for this image: Background, Moon, Tree, Grass and Clouds.  When I try to use the Move tool to move the Moon, the tool jumps to the Tree layer.  The same thing happens with the other layers as well (except the background layer).  How

    I have several layers for my image: Background, Moon, Tree, Grass and Clouds.  When I try to use the Move tool to move the Moon, the tool jumps to the Tree layer.  The same thing happens with the other layers as well (except the background layer).  How can I keep the move tool from jumpimg to the Tree layer?

    1. Pre-select (highlight) the layer to move in the Layers panel.  or-
    2. [ALT+Right mouse click]  to select the wanted layer in the image window.
    and maybe
    3. Set the PS option to "Auto-select" a layer with cursor hover.  (can be very confusing!)

  • How to move a selection into another selection in elements 12

    how to move a selection into another selection in elements 12

    Open picture B, the one you wish to select something from to add to another picture.
    Use one of the selection tools, e.g. selection brush, lasso tool, to select the object. You will see an outline ("marching ants") once the selection is complete
    Go to Edit menu>copy to copy the selection to the clipboard
    Open picture A, then go to Edit>paste
    Use the move tool to position object from picture B.
    In the layers palette you should see picture A as the background layer, and object B on a separate layer

  • I have AE error (17 :: 19)    i don't move compotion Layer becuase of this error (17 :: 19)

    i don't move compotion Layer becuase of this error (17 :: 19)     T.T     how can i do

    Sorry, I have no idea what you are trying to do to what. We need a detailed explanation of exactly what you are doing before we can help. The only thing I get is that you are moving a layer and you are getting an error. It is important to know what kind of layer, what kind of project, and what version of AE you are using.
    BTW, you can write in your native language because this forum has a translator that works very well so we can probably figure out exactly what you are saying if you give us some details.

  • How to move elements (figures and tables) to float

    Hi all,
    We have created an XSLT for the XML-IN in Indesign, its working fine and all the styles are applied automatically and figures and tables were placed as inline.
    Now we need to move the INLINE elements to FLOATING.
    How to move the INLINE elements such as figures and tables to Floating. This is for automation purpose.
    We are stuck up, please suggest.
    Our requirement is need to move the "figures" from "Inline" to "float" for auto pagination purpose.
    Please give us a route to end with proper result. We are at learning stage of Java Script.
    We use Indesign CS3 with JavaScript, I am not asking the full code, just give us an idea, how to pick from the XML tree and make it as float.
    Kavya

    Use one of the selection tools, e.g. selection brush, lasso tool, to select the object, then place it on its own layer.
    In your example, you would select the moon. You will see "marching ants" surrounding the selection, delineating  the boundary of the selection and that it is active.
    To place the object on its own layer, go to Layer menu>new> layer via copy, or CTRL+J. You will see the object surrounded by transparency (checkerboard pattern).
    Use the move tool to position the moon object wherever you want
    Place a blank layer below the layer created in step #2, then fill it with your new background.
    You can select multiple objects and place them this way to suit. Again, back to your hypothetical of.10 objects on 10 layers, you can link these layers by pressing CTRL+left clicking on each of the 10 layers in the layers palette.
    If you use the move tool, you will see that they move as a block. If you are unhappy with one of the layers as you go along, simply delete it, and replace it with a new one.
    As for naming the layers, right click on a layer, and from the menu select "rename" layer to bring up the layers properties, then rename it to something meaningful.
    Good luck with your project.

  • How to move a page number in front of an image

    how to move a page number in front of an image on pages??

    Hello albertlini,
    This can be done by chosing to move the image to the back via the Arrange tab.
    Move an object to the very top or bottom of the stack: Click Front, or click Back.
    Pages Help - Layer, group, and lock objects
    http://help.apple.com/pages/mac/5.5/#/tan5eab46568
    Cheers,
    Allen

  • Painting Process Documentation: Stamp Visible, Move to layer Set and hide

    I like to capture my screen while painting and when I am done I make an animated GIF from these "process shots". I am trying to automatize the process and I have managed to come up with this which meets my needs:
    #target photoshop
    app.bringToFront();
    // Stamp visible Layers
    var idMrgV = charIDToTypeID( "MrgV" );
        var desc2 = new ActionDescriptor();
        var idDplc = charIDToTypeID( "Dplc" );
        desc2.putBoolean( idDplc, true );
    executeAction( idMrgV, desc2, DialogModes.NO );
    // Move Active Layer to the Bottom of LayerSet "process"
    var activeLayer = activeDocument.activeLayer;
        var processFolder = activeDocument.layerSets.getByName("process")
        activeDocument.activeLayer.moveToEnd (processFolder);
    Now I would like to add a conditional to check, whether or not the "process" layer-set exists and if it does not, create it. This should look something like this:
    // Process Image Capture
    // V 0.3
    // PIC Stamps Visible (creates a new layer that combines all visible information in flattened form) and moves that to a "process" Layer Set.
    // Layer is then hidden.
    // If Layer Set is not there, it will be created.
    #target photoshop
    app.bringToFront();
    // Check for "Process" Layer-Set on root. Create, in case it is not present.
    if (!activeDocument.layerSets.getByName("process")) {
         activeDocument.LayerSets.add();
         activeDocument.LayerSets.name = "process";
    /* else {
    // Stamp visible Layers
    var idMrgV = charIDToTypeID( "MrgV" );
        var desc2 = new ActionDescriptor();
        var idDplc = charIDToTypeID( "Dplc" );
        desc2.putBoolean( idDplc, true );
    executeAction( idMrgV, desc2, DialogModes.NO );
    // Move Active Layer to the Bottom of LayerSet "process"
        var activeLayer = activeDocument.activeLayer;
        var processFolder = activeDocument.layerSets.getByName("process")
        activeDocument.activeLayer.moveToEnd (processFolder);
        activeDocument.activeLayer.visibility = false;
    The condition seems to be what causes the problem, but I have no idea how to fix it. Can somebody help?

    Ok, here is the script that does the deed, it requires an additional function to catch what getByName() returns.
    // Process Image Capture
    // V 1.0
    // PIC Stamps Visible (creates a new layer that combines all visible information in flattened form) and moves that to a "process" Layer Set.
    // Layer is then hidden.
    // If Layer Set is not there, it will be created.
    #target photoshop
    app.bringToFront();
    // Check for "Process" Layer-Set on root. Create, in case it is not present.
    if (!hasRootLayer("process")) {   
        var addedLayer = activeDocument.layerSets.add();
        addedLayer.name = "process";
    // Stamp visible Layers
    var idMrgV = charIDToTypeID( "MrgV" );
        var desc2 = new ActionDescriptor();
        var idDplc = charIDToTypeID( "Dplc" );
        desc2.putBoolean( idDplc, true );
    executeAction( idMrgV, desc2, DialogModes.NO );
    // Move Active Layer to the Bottom of LayerSet "process"
        var activeLayer = activeDocument.activeLayer;
        var processFolder = activeDocument.layerSets.getByName("process")
        activeDocument.activeLayer.moveToEnd (processFolder);
        activeDocument.activeLayer.visibility = false;
    // Function to check whether "process" layer exists, passes result back as a boolean
        function hasRootLayer(layerName){
        var hasProcessLayer = false;
        try{
            hasProcessLayer = (typeof activeDocument.layerSets.getByName(layerName) != "undefined");
        }catch(e){}
        return hasProcessLayer;

  • How to move floats to the next page?

    Hi All,
    Can anyone help me on this?
    How to move floats to the next page the same position?
    Thanks in advance

    @Learner – you can duplicate the object to the next page and remove the original.
    If the original one is anchored you also have to account for its position, because duplicating an anchored object will move it.
    Here an example for duplicating a selected object to the same page.
    //DuplicateAnchoredObject_SELECTION_SNIPPET.jsx
    //Uwe Laubender
    * @@@BUILDINFO@@@ DuplicateAnchoredObject_SELECTION_SNIPPET.jsx !Version! Fri Apr 12 2013 07:53:31 GMT+0200
    var sel = app.selection[0];
    var x = sel.geometricBounds[1];
    var y = sel.geometricBounds[0];
    //The duplicate() method without an optional argument:
    var dup = sel.duplicate();
    //NOW: the duplicated objects is at the inner border of the page
    //To move it to its original position we need the following:
    var xd = dup.geometricBounds[1];
    var yd = dup.geometricBounds[0];
    dup.move(undefined,[x-xd,y-yd]);
    That snippet can be enhanced for duplicating to a certain page, because the duplicate() methods can take arguments like "Page", "Layer", "Spread" etc. For details see the DOM documentation at:
    http://www.jongware.com/idjshelp.html
    One caution here: to make that work the way you want with facing pages, you have to take into account, that your coordinate system must be changed to "per page" by the property "RulerOrigin" of the ViewPreferences.
    This said, here is a working example for duplicating a selected object to page 3 of the current document:
    //DuplicateAnchoredObject_TO-DIFFERENT-PAGE_SELECTION_SNIPPET.jsx
    //Uwe Laubender
    * @@@BUILDINFO@@@ DuplicateAnchoredObject_TO-DIFFERENT-PAGE_SELECTION_SNIPPET.jsx !Version! Tue May 14 2013 10:11:29 GMT+0200
    var d=app.documents[0];
    var oldRulerOrigin = d.viewPreferences.rulerOrigin;
    var sel = app.selection[0];
    var x = sel.geometricBounds[1];
    var y = sel.geometricBounds[0];
    //In case of facing pages we change the ruler origin:
    d.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    //Duplication of selected object:
    var dup = sel.duplicate(d.pages[2]);
    //NOW: the duplicated objects is at the inner border of the page
    //To move it to its original position we need the following:
    var xd = dup.geometricBounds[1];
    var yd = dup.geometricBounds[0];
    dup.move(undefined,[x-xd,y-yd]);
    //Restore the original ruler origin:
    d.viewPreferences.rulerOrigin = oldRulerOrigin;
    Of course, thiese snippets are working also with not anchored objects…
    Uwe

Maybe you are looking for