Help selection marquee tool

Hello

When we choose object via the marquee tool, I need to cut this object and paste in the same place as layer 1, and resize the object to 10% and re select the second object and do the same process.

But I'm unable to do this process.

Please find the bottom, any help is very appreciated.

aDoc var = app.activeDocument;

var salt = aDoc.selection;

// =======================================================

var idCpTL = charIDToTypeID ('CpTL");

executeAction (idCpTL, undefined, DialogModes.NO);

// =======================================================

var idslct = charIDToTypeID ("TPCV");

var desc16 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

ref10 var = new ActionReference();

var idLyr = charIDToTypeID ("Lyr");

Ref10.putName (idLyr, "Layer 1");

desc16.putReference (idnull, ref10);

var idMkVs = charIDToTypeID ("MKV");

desc16.putBoolean (idMkVs, false);

executeAction (idslct, desc16, DialogModes.NO);

aDoc.activeLayer.resize (105 105, AnchorPosition.MIDDLECENTER)

Alert ('OK', 'Test')

How to select the second need help object.

// =======================================================

var idCpTL = charIDToTypeID ('CpTL");

executeAction (idCpTL, undefined, DialogModes.NO);

var idslct = charIDToTypeID ("TPCV");

var desc25 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

var ref18 = new ActionReference();

var idLyr = charIDToTypeID ("Lyr");

ref18.putName (idLyr, 'Layer 2');

desc25.putReference (idnull, ref18);

var idMkVs = charIDToTypeID ("MKV");

desc25.putBoolean (idMkVs, false);

executeAction (idslct, desc25, DialogModes.NO);

aDoc.activeLayer.resize (105 105, AnchorPosition.MIDDLECENTER)

// =======================================================

var idCpTL = charIDToTypeID ('CpTL");

executeAction (idCpTL, undefined, DialogModes.NO);

var idslct = charIDToTypeID ("TPCV");

var desc30 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

var ref22 = new ActionReference();

var idLyr = charIDToTypeID ("Lyr");

ref22.putName (idLyr, "Layer 3");

desc30.putReference (idnull, ref22);

var idMkVs = charIDToTypeID ("MKV");

desc30.putBoolean (idMkVs, false);

executeAction (idslct, desc30, DialogModes.NO);

aDoc.activeLayer.resize (105 105, AnchorPosition.MIDDLECENTER)

Kind regards

Vinoth

The script that I found and modifed begins with a transparent activeLayer. It performs some tasks not necessary because you want to start with a layer with a selection. So instead of modifing the script to change the document mode, I modified the script to work with the other modes. I think that is should now work with grayscale mode, RGB, lab, and CMYK. Note, that I don't have to add a test for fashion and this may fail with other modes.

// original script can be found at  http://forums.adobe.com/message/4272787#4272787
// modified to start with a selection instead of a transparent layer
// and to work with other modes
// then resize each new layer
#target photoshop
if (app.documents.length > 0) {
    var percent = Number(prompt('Enter percent to resize. Please enter a whole number greater than 0.',10));
    if(percent != NaN && percent > 0){
        myDocument = app.activeDocument;
        var theMask = myDocument.channels.add();
        myDocument.selection.store(theMask);
        selectComponentChannel();
        var check = true;
        // set to pixels;
        var originalRulerUnits = app.preferences.rulerUnits;
        app.preferences.rulerUnits = Units.PIXELS;
        // set to 72ppi;
        var originalResolution = app.activeDocument.resolution;
        myDocument.resizeImage (undefined, undefined, 72, ResampleMethod.NONE);

        var theLayer = myDocument.activeLayer;
        myDocument.selection.load(theMask, SelectionType.REPLACE);

        // create work path;
        myDocument.selection.makeWorkPath(1);
        var subPathsNumber = myDocument.pathItems[myDocument.pathItems.length-1].subPathItems.length;
        // check for a high number of paths;
        if (subPathsNumber > 30) {
                  check = confirm("warning\rthere appear to be "+subPathsNumber+" elements.\rif this number is too high noise may have caused them.\rthis may result in a crash.\rproceed?")
                  };
        // do the operation;
        if (check == true) {
                  var thePathInfo = collectPathInfo(myDocument, myDocument.pathItems[myDocument.pathItems.length-1]);
        // create one path for every subpathitem:
                  for (var m = 0; m < thePathInfo.length - 1; m++) {
                            var theSubPath = thePathInfo[m];
                            var aPath = createPath ([theSubPath], m+"_path");
                            aPath.makeSelection(0, true, SelectionType.REPLACE);
                           myDocument.selection.load(theMask, SelectionType.INTERSECT);
        // layer via copy;
                            try {
                                      executeAction( charIDToTypeID( "CpTL" ), undefined, DialogModes.NO );
                                      myDocument.activeLayer.resize(100+percent,100+percent, AnchorPosition.MIDDLECENTER);
                                      myDocument.activeLayer.name = theLayer.name + "_" + m
                                      }
                            catch (e) {};
                            myDocument.pathItems[myDocument.pathItems.length-1].remove();
                            myDocument.activeLayer = theLayer;
                            };
                  theMask.remove();
                  };
        // reset;
        app.preferences.rulerUnits = originalRulerUnits;
        myDocument.resizeImage (undefined, undefined, originalResolution, ResampleMethod.NONE);
    }
};
////////////////////////////////////
////////////////////////////////////
////////////////////////////////////
////// function to create path from array with one array per point that holds anchor, leftdirection, etc, 2010 //////
function createPath (theArray, thePointsName) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.POINTS;
lineSubPathArray = new Array ();
if (theArray[theArray.length - 1].constructor != Array) {var numberOfPoints = theArray.length - 1}
else {var numberOfPoints = theArray.length};
for (var b = 0; b < numberOfPoints; b++) {
          var lineArray = new Array ();
          for (c = 0; c < (theArray[b].length); c++) {
                    lineArray[c] = new PathPointInfo;

                    if (!theArray[b][c][3]) {lineArray[c].kind = PointKind.CORNERPOINT}
                    else {lineArray[c].kind = theArray[b][c][3]};

                    lineArray[c].anchor = theArray[b][c][0];

                    if (!theArray[b][c][1]) {lineArray[c].leftDirection = theArray[b][c][0]}
                    else {lineArray[c].leftDirection = theArray[b][c][1]};

                    if (!theArray[b][c][2]) {lineArray[c].rightDirection = theArray[b][c][0]}
                    else {lineArray[c].rightDirection = theArray[b][c][2]};

                    };
          lineSubPathArray[b] = new SubPathInfo();
          lineSubPathArray[b].operation = ShapeOperation.SHAPEADD;

          if (theArray[b][theArray[b].length - 1].constructor == Array) {lineSubPathArray[b].closed = true}
          else {lineSubPathArray[b].closed = theArray[b][theArray[b].length - 1]};

          lineSubPathArray[b].entireSubPath = lineArray;
          };
var myPathItem = app.activeDocument.pathItems.add(thePointsName, lineSubPathArray);
app.preferences.rulerUnits = originalRulerUnits;
return myPathItem
};
////// function to collect path-info as text //////
function collectPathInfo (myDocument, thePath) {
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.POINTS;
var theArray = [];
for (var b = 0; b < thePath.subPathItems.length; b++) {
          theArray[b] = [];
          for (var c = 0; c < thePath.subPathItems[b].pathPoints.length; c++) {
                    var pointsNumber = thePath.subPathItems[b].pathPoints.length;
                    var theAnchor = thePath.subPathItems[b].pathPoints[c].anchor;
                    var theLeft = thePath.subPathItems[b].pathPoints[c].leftDirection;
                    var theRight = thePath.subPathItems[b].pathPoints[c].rightDirection;
                    var theKind = thePath.subPathItems[b].pathPoints[c].kind;
                    theArray[b][c] = [theAnchor, theLeft, theRight, theKind];
                    };
          var theClose = thePath.subPathItems[b].closed;
          theArray = theArray.concat(String(theClose))
          };
app.preferences.rulerUnits = originalRulerUnits;
return theArray
};
function selectComponentChannel() {
    try{
        var map = {}
        map[DocumentMode.GRAYSCALE] = charIDToTypeID('Blck');
        map[DocumentMode.RGB] = charIDToTypeID('RGB ');
        map[DocumentMode.CMYK] = charIDToTypeID('CMYK');
        map[DocumentMode.LAB] = charIDToTypeID('Lab ');
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( charIDToTypeID('Chnl'), charIDToTypeID('Chnl'), map[app.activeDocument.mode] );
        desc.putReference( charIDToTypeID('null'), ref );
        executeAction( charIDToTypeID('slct'), desc, DialogModes.NO );
    }catch(e){}
};

Tags: Photoshop

Similar Questions

  • PS Elements 13 - do not select marquee tool

    Have recently updated to 13 PSE and don't know if I used the marquee from the upgrade tool.  Any effort to select with the marquee tool cause no selection.  It's almost as if the tool does not know the left mouse button is pressed (have tested the left button of the mouse with several other applications, no problems and works of left button of the mouse to other PES functions).  Also tested to ensure that it is not a case of drawing selection lines simply do not - I have try a selection then copy/paste and I always get a dough in the center of the layer.  Tried to reset and reboot PSE without change preferences.

    Hoping someone has seen this before and has any suggestions on what I can try.

    Thank you

    Try to reset the tool. There should be a box with lines on this subject on the options bar of the tool on the right. Click on this to reset.

  • Help! Marquee tool continues to change my selection!

    IM starting to get really desperate... Please help me with this problem:

    Each time I'm using the lasso polygonal tool photoshop adds 'cubic' to my selection.

    So I can't fill a simple selection without getting these cubes along and its

    Super boring!

    Here is a picture of how it looks:

    Bild 1.png

    Please note it is a complete empty document and it does not help to new documents.

    The big triangle in the selection is the one that I wanted to do, but as you can se, photoshop

    has added another form inside with another place on the lower left side of it.

    The squares appears always different, sometimes just sometimes more big like this.

    Im getting CRAZY!

    Edit: I downloaded the latest updates and it now seems to work fine. A weird bug in photoshop maybe?

  • get the selection instead of the puppet pin tool marquee tool

    I imported a png file in the new composition and wanted to distort the image with the puppet tool, but instead of the puppet pin tool that I always get the marquee tool

    tried to keep Alt, Shift, Ctrl, did not help

    puppet pin tool works fine on the other compositions. It's the first time I encounter such a problem with the puppet tool. What is going on?

    AE CS6 on win7

    First question, what size is this file? I don't see any dimension.

    Second question, it is necessary to have layers in this picture? Looks like you apply puppet pin on the entire fly.

    Third question, have you tried to reduce the size of the file in Photoshop to about the size of your computer and then saving it as a png 24-bit or single-layer PSD or tiff with an alpha channel?

    It is difficult to know because there is no detail about right PSD, but it could be wrong, too much color space, or have another problem that I don't see.

  • Cntrl + [PS-CC/15] Marquee tool

    How can I change to use the single arrow when I press on the control using the marquee tool? As before, in Photoshop CC/14. Now, the arrow is one who seizes anything on top with left click. (Or when the new shortcut is.)

    This

    computer-cursor-pointer.jpg

    instead of

    screenshot-cdn.flaticon.com-2015-11-10-09-57-08.png

    TKS

    When you have selected move - not the marquee tool tool, you have "Auto select" selected? This will cause the same behavior when you press the CTRL key when you use the marquee selection tool: he chooses the top layer of the majority to pass.

  • I need help selecting a vector has individual anchor points

    I need help selecting a vector has individual anchor points in CS6. I could until yesterday. I don't know why this happened but I really need help fixing this problem!

    Hi Seno,

    Please follow the steps below and see if that helps.

    > Launch Photoshop

    > Create a path

    > Choose the direct Selection tool

    > Click on the path to move.

    Let me know if it helps.

    ~ UL

  • Editing audio first in Audition, when the marquee tool, the changes do not take effect or I would like to export.

    Editing audio first in Audition, when you use the marquee tool to get rid of unwanted 'knocking' noise audio, the changes do not take effect or I would export after changes in the spectral display.

    No indication on how to save the changes to the marquee selection tool would be great.

    Hmm.  You did something for the audio in the selection?  It looks not to the file has been modified at all, and the registration option is not enabled, unless a change has occurred.  I suppose you try to remove or reduce the volume of the sound inside the selection rectangle, is that correct?  With this selection, you can press DELETE to remove it completely, or set the volume floating just above the selection of lower button.

    It also seems that you stopped reading, and while that save the selection under will be activated pause, of many other commands will not.

    So, try in the following order:

    1 stop playback.  Is File > Save now activated?

    2. otherwise, do some edit to this file.  You will know that the file is considered 'dirty' when an asterisk * appears next to the name of the file in the files Panel and the top of the editor Panel.

    3. There is no number 3.  I feel confident, one of the first two options will work.  Once the file is saved and overwritten, go back to the first and you should hear the content updated the.

  • Can I lock the marquee tool to make the only rectangles?

    I lose track of the issue of whether the selection tool is selected - and press M to get, and often this means I get the circle marquee. Is it possible to lock the marquee tool to make a rectangular selection only? that is, I have to reach the top in the Toolbox to make the circle--as was the case in earlier versions of the PSD.

    There is one very annoying thing that I hope that they have considered!

    Correction: Based on the M key is changing your selection Rectangle rectangle, ellipse, then you should go to Edit > Preferences > General and tick "use Shift key for tool switch."

    This will require then you hold the SHIFT key before you press M and your marquee tool will stay on the rectangle.

  • I lost the marquee tool cursor control

    Running PSE9 under MAC OS X 10.6.8 Snow Leopard.

    I was setting in flag of borders of several pictures using the marquee tool > select > feather > inverse selection > remove and it works well.  Then I started another picture and the marquee selection tool now won't give me a rectangle of varying size, but rather a little square that moves, but will not change its size (unlike the option shift which, if I understand correctly, lock in a square shape, but allows a change of size).  I have to hit keys wrong somehow, but what?  And how to return to normal operation?  Attached picture shows the small square in the upper left corner of my image.

    Oh yes, Happy New Year!

    Square select.jpg

    To the left of the options bar is a small triangle. Click on it and choose Reset tool.

  • Cannot select a tool

    When I select a tool, nothing happens... my cursor remains a useless white arrow!  What's wrong??

    Eluria,

    In addition to the suggestions by Scott, try the following (you may have tried / some of them already) and see if that helps you (the following is a general list of things, you can try when the question is not in a file specific; 3) and 4) specifically may be corrupted preferences):

    (1) close Illy and open again.

    (2) restart the computer;

    (3) close Illy and press Ctrl + Alt + Shift / Cmd + Option + shift during startup (easy, but irreversible);

    4) to move the folder with closed Illy (more tedious but also more thorough and reversible);

    ((5) browse and try the relevant among the other options (point 7) is a list of the usual suspects among other applications which can disturb and confuse Illy);

    Even worse, you can:

    (6) uninstall, run the cleanup tool if you have CS3, CS4, CS5, CS6 and reinstall.

    http://www.Adobe.com/support/contact/cscleanertool.html

    Hi Scott. By fall. Always been there?

  • The height adjustment of product with the marquee tool. How?

    When I use the marquee tool to draw a shape - square/circle etc. I sometimes don't get the size exactly to my needs. is there a way to fine-tune the size of the product? I guess that there is a key combination that will allow me to make fine adjustments upwards or downwards for the size of the shape. Does anyone know how to do this without closing and starting again and again until I get what I ask?

    Hello.

    In the toolbar, you can set a specific size in pixels or whatever.

    Or, you can do a right click on the selection and choose transform selection.

    Lee

  • Selection Brush tool error

    When I try to use the selection Brush tool I get an error that says: "could not use the brush selection because of a program error." Someone at - he a clue as to how I can solve this problem. I use Windows 7, PES 9. Since then, there is no error code or any suspicion that is contained in the error message I have no idea what to do. Suggesstions any help would be appreciated.

    Start by going to the left end of the toolbar options for the selection brush. There is a small triangle. Click on it and choose Reset tool. If that does not do it, quit the editor, then it again in the home while pressing ctrl + shift + ALT screen keep the keys down until you see a message asking if you want to delete the startup parameters. You do.

  • Using elliptical marquee tool hits

    How to make several shots with marquee tool without starting a new form.  When I pick up the pointer and move to a different location on the ellipse, it opens a new ellipse. I want to continue with the same ellipse that I started.  There must be some keys I can hold down which allows me to do.  Also, where can I find a list of the main features in the future.

    Hello!

    If you press the space bar once you have started the selection, you can move freely.

    A list of shortcuts is available here: http://morris-photographics.com/photoshop/shortcuts/index.html

    Look also at the tips of Trevor: http://morris-photographics.com/photoshop/tips/tips-interface.html

    Follow Julieanne Kost's Blog: http://blogs.adobe.com/jkost/

  • How to install a local help for the tools of cmd.exe and command line on Windows 7?

    Hello

    for many applications, the command line (cmd.exe) is a good choice to get results with minimum effort. The shell has continuously been improved over the years, at least until Windows XP.

    All the command line tools have a short help screen (using the /? option). When you need more information, you use Windows system for example from the Explorer Help. It is very good.

    Now, Windows XP Help content was installed on site, and the operating system. In Windows 7, my computer wants to go to the Microsoft web site on the internet and there is no local help available. The operating system seems to be incomplete. This makes the help system unusable on a computer without internet access or when the server is not accessible.

    So my question is: is it possible to install a local copy of help for the tools of cmd.exe and command line under Windows 7 or do we have to go back to Windows XP?

    Thank you

    Martin

    Download it directly from Microsoft - Windows Command Reference

  • Need help. My tool Panel disappeared and I need to get it back

    Need help. My tool Panel disappeared and I need it back.

    Window > tools

Maybe you are looking for

  • iOS 10.0.1 "not allowed to use the restricted network port.

    I just upgraded my iPad Mini iOS 10.0.1. He is now running Safari 10. I tried to visit an internal/private IP on port 4190 using HTTP. I get an error that says: Safari cannot open the page. The error was: "not allowed to use the restricted network po

  • Icloud text?

    I just got a text on my Iphone of Icloud saying that my apple ID has been suspended pending termination. I just logged in Icloud on my mac and everything seems ok. Is this fish?

  • Help? With the help of file system Ext3 on key USB on Linux RT target

    We have been affected by problems with the SD cards and USB drives formatted in FAT32 on some devices, according to Linus RT of long-term monitoring (mainly the cRIO-9035). It seems that readers are vulnerable to fluctuations in current and unexpecte

  • Native histogram VI seems to have error

    Hi all I worked on something where I need histograms, but it seems to me that there is something wrong with LabVIEW vis native. As an attachment, I send you an example I did to support what I say. I want the histogram to have 1,000 locations with the

  • Cancel entry jpeg.vi problem

    Hello I have a problem with writing to JPEG VI: when I choose to cancel the dialog box, my program is in trouble, as if I've changed the State of my state of the computer... or if I reset. So my question is: How can I manage it? I have no access to w