Scripting the path in Quick Selection Tool

Hi,
I'm trying to build a JS script which:
1. opens an image
2. selects the quick selection tool
3. does the selection following a pre-defined path
4. puts the unselected area to white
5. saves the image
The problem is in step 3. All the other steps can be recorded with ScriptListener, but the path is not. So the question is:
How can I tell to my script a path to follow while using Quick Selection?
How can I do it, for example, with a very simple path, say a line from pixel (50,50) to (50,200)?
Many thanks!

This would select the first path and stroke it with the Quick Selection Tool, for the second part it uses the Action Manager recorded with ScriptingListener.plugin.
app.activeDocument.pathItems[0].select();
// =======================================================
var idStrk = charIDToTypeID( "Strk" );
    var desc7 = new ActionDescriptor();
    var idnull = charIDToTypeID( "null" );
        var ref7 = new ActionReference();
        var idPath = charIDToTypeID( "Path" );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref7.putEnumerated( idPath, idOrdn, idTrgt );
    desc7.putReference( idnull, ref7 );
    var idUsng = charIDToTypeID( "Usng" );
    var idquickSelectTool = stringIDToTypeID( "quickSelectTool" );
    desc7.putClass( idUsng, idquickSelectTool );
    var idPrs = charIDToTypeID( "Prs " );
    desc7.putBoolean( idPrs, true );
executeAction( idStrk, desc7, DialogModes.NO );

Similar Messages

  • How to save the selection of quick select tool using scripts?

    I am writing a script to record the edit history and I want to save the select area of quick select tool using scripts. 

    Yeah, that's true. If we active the HistoryState, we can see the selection area in  photoshop, however when we save the HistoryState in  jpg, the dotted line disappears. 

  • LevelUp Level 4 Mission 13 Step 2 of 4: No further reactions after using the quick selection tool.

    The work is done.
    The flower is selectet. But now the 3 Step is failing.
    What´s wrong?

    Hi Mira. I have the same problem.  
    I got stuck in mission 13 - Copy an object out of photo. I already made selection with Quick Selection Tool. And then I tried all. I refined edges. I made a new layer, I saved a path, made a mask. But I am still on step 2 . What LevelUp wants? Can You help me please?

  • I would like cut out an object using the quick select tool and drop the object into another picture. Can anyone help

    I am using background pictures and want to cut out objects from other jpegs using the quick select tool and drop them into the background picture. So if i have a banana and select the object i need to copy the banana into the other background.
    Hope this makes sense.
    Gary

    Select banana. Right click>layer via copy. Move tool. Click and drag to other file. Drop on image.
    OR: load the background and banana in one stack (File>Scripts>Load File Into Stack). Select banana and layer via copy or create layer mask.
    Benjamin

  • Change the background with a bunch of kids? Quirky quick selection tool?

    Main Objective:  How can I change the background behind a bunch of kids? My quick selection tool is quirky! Like the HS kids in the pic….
    The 2nd photo is what I am looking to do.
    When I try the quick selection tool, it's all wonky & quirky now.  I can't select little bits any more! It just basically takes the whole stinkin' page! What did I do?!  Are there defaults?
    On watched video number 85 today, I tried to use my stylus and the bamboo pad. (Good grief; that's another story...it moves & I'm not even touching the pad; what's up with that?! Way too confusing, so I gave up!)
    Anyway..this is what I need.
    What is easier for me to remove the background?  The kids?  Pretend I didn't say yes to help with this project?
    All the video tutorials on how to remove backgrounds is always on a perfect object...not a real life mess of a class.  So... HELP!!!
    Please.
    This is WAY over my head; but I'm trying. Really.
    On a mac with CC membership.

    You may find it easier to select the kids than the background. Instead of copying to new layer, create a mask, then you can add or remove as you like.
    In the top tool bar click the icon in the middle to add to selection. Then use your option key to remove.
    When you are nearing done, you can then refine the mask. If necessary you can use the other selection tool for straight lines, large areas etc. For tight places you may prefer to use the quick mask tool (lowercase q)
    Take your time, you will get it. And like I said, using a mask will let you take a breather. It can help walking away for a bit.

  • Quick selection tool,How to programme the function of this tool?

    Recently, I intend to extract from a picture on the edge of oil tank。I found  that this quick selection tool  can meet my
    requirement。 But I do not know how to achieve it in VC ++ 。I would like to ask somebody who knows it???thanks~~~~~

    The question doesn't make sense in the SDK forum either.
    Why are you trying to control the tool programmatically?
    And I don't think you really can control that tool programatically - it's meant to be interactive.

  • Quick selection tool doesn't snap to to the nearest area. Working more like a lasso tool and the add layer button doesn't seem to creat the cutout that it should.

    Quick selection tool in elements 13 doesn't snap to the nearest border area of the photo. Works more like a lasso. Also the add layer button when clicked on only brings up a black layer, not a black mask with a hole where I just cut.

    Which OS are you working on?
    Please try resetting your tools from Photo Bin flyout menu.
    1. Open Photo bin.
    2. Click on Fly Out menu
    3. Click on option Reset all Tools
    4. Relaunch Editor13
    and see if it helps.
    Thanks,
    Anwesha

  • I'm trying to use the quick selection tool in Photoshop Elements 12 but it keeps getting stuck on minus.  How do I fix this?

    I'm trying to use the quick selection tool in Photoshop Elements 12 but it keeps getting stuck on minus.  I've reinstalled twice and it will work for a little while and then get stuck again.  When I select something, I have one shot at it and as soon as I let go of the mouse it switches to minus and I can't add anything else.  How do I fix this?

    When a tool misbehaves, go over to the far upper right corner of the tool options area and click the four-lined square. Choose Reset Tool from the popout menu.

  • Cannot find the Quick Selection Tool (previously paired with the magic wand tool) on Illustrator CC (newest version installed on October 14, 2014)

    I have just installed a new version of Illustrator CC and CS6 on October 14, 2014 and I couldn't find the Quick Selection Tool on this version, previously this tool is located with the magic wand tool

    I don't remember a quick selection tool in Illustrator. Are you sure this was in Illustrator?

  • How do you change the minus symbol on the quick selection tool to a plus symbol? im finding it difficult to select an area.

    how do you change the minus symbol on the quick selection tool to a plus symbol? im finding it difficult to select an area.

    You can use the Alt/Option key to toggle between add + and subtract -
    http://helpx.adobe.com/photoshop/using/making-quick-selections.html
    First though select the Add to Selection in the tool options bar for that to work.

  • When I use the quick selection tool in Photoshop CS6 my monitor flickers

    When I use the quick selection tool my monitor starts flickering what do I need to change in my set up.

    I'm sorry Jeff I know better.  I'm using Adobe CS6 and running Window 8.0 operating system. Thanks for your help. I also run Adobe photoshop element 11 on the same system with no problems
    <Removed by Moderator>

  • Quick selection tool vs clipping path

    what is better to silhouette an image? a quick selection tool with follow up detailing or a clipping path?

    a path is very control-able and great for well defined edges. It can be used to create a selection, which can be made into a mask, which can be refined and edited with a quickmask among other tools. There is rarely ever a one shot solution. Usually a combination of tools and techniques are required.

  • Can we disable the anti-alias option for the quick selection tool?

    Can we disable the anti-alias option for the quick selection tool?
    I can deselect it with the magic wand but not with the quick selection. Any ideas?
    thanks,
    Dominik

    I don't think you can, but in the refine edge dialog you can use the contrast setting to get rid of most of the anti-alias.
    MTSTUNER

  • Why does Quick Select tool make the edges all jagged?

    My Photoshop Elements Quick Select tool is great for selecting an item, a shirt say, and then I copy it and paste it onto a new page with a white background, thus eliminating the background I had before.  The only thing is that it makes the edges of the item all jagged and then I have to go with the eraser tool and smooth everything out.  This is not easy because my hand is not that steady.  Also it is very hard on my eyes.  I've already had to get new glasses.   The original image, a shirt for example, has sharp delineation all around it.  How can I copy it so that when I paste it onto a new background, it stays sharp and I don't have to spend ages, sometimes half an hour or more, trying to smooth out its edges?  Thanks.

    Hi Barbara,
    Thanks for your answer about using Refine Edge.  It works very well.  Thanks so much.  Is there a way that I can get the edge really sharp but not jagged?  I've tried Smooth 8 and Feather 0 but the garment still doesn't have as sharp an edge as the original photo.
    Many thanks also for your answer to Jane regarding Fill or Unfill Workspace.  I couldn't find it even after a laborious task of copying every option screen in my original Photoshop Elements 6 and then comparing each photo to every option screen on my new Photoshop.  It never would have occurred to me to look in Application Frame.  I, like Jane and others, do not like working with my entire Workspace blacked out.
    Thanks again.   Would you have a suggestion re. my first paragraph herein?  Thanks.

  • When working with quick selection tool (and not only) the whole psd file gets damaged.

    Hello there,
    Since I first tried Photoshop CS6 on PC I encounter the following problem: when I use quick selection tool at some point the selection gets completely random and I see parts of my artwork disapear. Even after closing the file without saving the changes I see the artwork completely corrupted, without any possibility to recover. As if parts of the image were deleted.
    The problem persisted after I changed to Creative Cloud on Mac (I'm running OS X 10.8.5.)
    I have just seen that it also happens when I work with regular layer masks.
    I desperately need to fix this problem because I cannot keep using hours of retouching work again and again.
    Hope someone can help.
    Cheers
    Julia

    I am also having the same exact issue. This is the third time this has happened in about six months. I use the quick selection tool and I see a alpha mask that looks truncated and it show random parts of the image in the mask which has nothing to do with the selection. But the worst part of this is that my retouching layer the only other layer comes back completely empty even if I try to save the file in various other file types like tiff and it comes back empty. I'm losing a lot of retouching time here. I also hope some else has an answer.
    Thanks
    Mike

Maybe you are looking for

  • How can I fix my front camera

    Guys I need your help I can't use my camera when I reverse it in front of me but when I reverse it again it would work what should I do can you really pls help me I only use my camera twice and now I can't use it anymore.  Pls answer............

  • Find the difference between previous row value

    Hi All, I have a Property Rent Review table which holds the last rent update done on a property. I need to be able to compare the rent change (%) at any interval for a property. - so the query should allow to pull the property rent at 2 or more point

  • New Document button to create/open document in Office Web Apps rather than through Template.doc in client's MS Word

    Greetings all, We have a particular campus with exceptionally limited access on their machines -- essentially, they can browse the web (access our Intranet) but not write information to drives or update their MS Word to read the new DocX format (or i

  • Import Templares from Motion to DVDSP?

    I can't find a template in DVDSP that is appropriate for my subject, but can find several in Motion that fill the bill. Is it possible to import a Motion template into DVDSP in a way that converts it to a useable file in DVDSP? If so, what are the st

  • Palm Z 22 does not synch anymore

    No device Suddenly, after many years, my palm Z22 won't synch anymore!  I have tried everything I can think of...but no success...I am running on vista or xp...nothing changed on my computers at all...it is really frustrating.  Can anyone help please