Identify and apply the mask by LVR or RVlA

Hello everyone, I can't modify this code. It applies a mask by a selection ("LVR"), but if you don't have a choice, it displays an error.

I need that if there is no selection, then it creates an empty mask ("RVlA"). Can not understand how to make this "if / else".

cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };


function Temp() {

  function step1(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putClass(cTID('Nw  '), cTID('Chnl'));
    var ref1 = new ActionReference();
    ref1.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Msk '));
    desc1.putReference(cTID('At  '), ref1);
    desc1.putEnumerated(cTID('Usng'), cTID('UsrM'), cTID('RvlS'));
    executeAction(cTID('Mk  '), desc1, dialogMode.NO);
  };

  
  step1(); 
};
Temp.main = function () {
  Temp();
};

Temp.main();

Finally I got it! I'm a bad programmer, but help adobe is as bad as

cTID = function (s) {return app.charIDToTypeID (s) ;};}
sTID = function (s) {return app.stringIDToTypeID (s) ;};}
function Temp() {}
Southeastern var = ("LVR");
var Selnes = ("RvlA");
  function step1 (withDialog, doc) {}
   
    if(doc == undefined) doc = activeDocument;
    var = doc.activeHistoryState;
    doc. Selection.Deselect ();
    var dialogMode = (withDialog? DialogModes.ALL: DialogModes.NO);
    var desc1 = new ActionDescriptor();
    DESC1.putClass (cTID ('Nw'), cTID ('one'));
    var ref1 = new ActionReference();
    Ref1.putEnumerated (cTID ('one'), ('one') cTID, cTID ('Msk'));
    DESC1.putReference (cTID ('At'), ref1);
    If (as! = doc.activeHistoryState) {}
    DESC1.putEnumerated (cTID ('Usng'), ('UsrM') cTID, cTID (SelY));
    doc.activeHistoryState = have;
    }
    else {}
        DESC1.putEnumerated (cTID ('Usng'), ('UsrM') cTID, cTID (Selnes));
    }
    executeAction (desc1 cTID ('Mk'), dialogMode.NO);
  };
  
  Step1();
};
Temp.main = function () {}
  Temp();
};
Temp.main ();

Tags: Photoshop

Similar Questions

  • Select and apply the mask

    Hello!

    I upgraded to the PS 2015.5 version and not the herramineta appears "perfect edge " appears instead " select and apply mask " . In this new space I can not use any of the tools panel on the left (fast selection tool , brush, etc. ) . 

    What may be because the problem ??

    Thanks in advance

    Hi axe_juan,

    Selection and masking of space replaced him refine edge - more information about it here: selection and masking part of a photo. Tutorials Photoshop Adobe CC

    You are looking for, or can you elaborate a bit more on what your question is?

    Concerning

    Pete

  • What computer privileges must install and apply the updates for Creative Apps clouds using Windows 7?

    What computer privileges are required to install and apply the updates for Creative Apps clouds using Windows 7?

    When you work for a company that controls the software installed on your computer, it is important to know if IT supports is necessary to install and apply the updates when updates are available.

    It is important to know this information before you buy.

    Thank you for your support.

    ~ Paul Miller

    admin command is required for installation or any changes made to the software from your computer.

  • Help with a script that detects the content in a cell and apply the cell style to line

    Hello


    I am trying to add an article to my table formatting script that is a cell with the word 'Budget' (but this can be written as ' Budget:' or ' Budget: (E) "- but without the speech marks) and apply the cell Style - SponsorCells - to all the cells of the whole line. I currently have on what it will, but it does not work:


    function checkWhichTable()
    {
    // ensure the user made a selection
    if (app.selection.length != 1)
    return null;
    var currentTable = app.selection[0];
    if (currentTable.hasOwnProperty("baseline"))
    {
    currentTable = app.selection[0].parent;
    }
    while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
    currentTable = currentTable.parent;
    if (!(currentTable instanceof Table))
    {
    // No table selected
    return null;
    }
    return currentTable;
    }
    app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    
    
    function checkUserSelection ()
    {
    var a_table = checkWhichTable();
    if (a_table == null)
    {
    if (confirm("No table selected. Do you want to process *all* tables?") == false)
    return;
    allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
    for (aTable=0; aTable<allTables.length; aTable++)
    {
    processTable (allTables[aTable]);
    }
    } else
    {
    processTable (a_table);
    }
    }
    function processTable(table)
    {
    // do something here!
    
    
    //Set 1st Row Height
    table.rows[0].height = "30mm";
    
    
    //Find Text in Cell and apply Cell Style to Row 
    var  
      myCellText=['Budget', 'Budget:', 'Budget: (E)'];  
     var myRegEx = new RegExp("^("+myCellText.join("|")+")$");
      for (i=0; i<table.cells.length; i++)
      {
        if (table.cells[i].texts[0].contents.match(myRegEx))
          table.cell[i].appliedCellStyle = "SponsorCells";
      }
    
    
    //end - do something here!
    }  
    


    I can get the script to apply the cell style to "SponsorCells" for each cell that contain the word 'Budget' etc, but I need cell ever on this line to have the cell style applied. I tried to re-write line 56 which applies the style to a cell, but I can't seem to make it work. Any help would be great.


    Separate on this issue, I would like to have a line of code similar to the 46 line, which sets the 1st height of lines, but I would like to say "If a cell has 'A cell Style' and then applies the value height 10 mm". If someone could result as a help of bonuses, things would be great double.


    Thanks in advance!

    But that could be painfully slow. To speed things up, follow these steps:

    var cells = table.cells.everyItem().getElements();
    for (var i=0; i
    

    It is faster, because it creates an array of cells with a call to table.cells, which is several times faster than calling table.cells. And before assigning to line 12mm height is useful to check if it is already 12 mm. checking things in InDesign and do things only when it is necessary is much more effective than simply doing things even if they are not necessary.

  • Search for characters, nested and apply the Cstyle

    I have

    you want to find the nested applied characters and apply the Cstyle, but my capture of code all the text in a document. Can you please guide me,

    nestedreport();

    function nestedreport() {}

    myDoc var = app.activeDocument;

    var myDocPath = myDoc.filePath;

    var myDocName = myDoc.name;

    try {}

    app.findGrepPreferences = app.changeTextPreferences = null;

    app.findGrepPreferences.findWhat = "^.» + » ;

    myFind = myDoc.findGrep (false);

    var ntexts = new Array;

    for (i = myFind.length - 1; i > = 0; i--)

    {

    if(myFind[i].contents.nestedStyles==null)

    {

    ntexts.push (myFind [i]. Happy)

    ntexts.appliedCharacterStyle = "Nested";

    }

    }

    }

    {catch (e)}

    }

    Screen shot 2015-07-21 at 2.26.33 PM.png

    Hello

    I'm still somewhat struggled with the final goal, however to make a small step:

    To detect a string that is formatted using nestedStyle (part of the content of the paragraph), you can use this:

    assuming that ==> text is selected - say a paragraph

    var
      cCharStyle,
      charStyles = app.selection[0].characters.everyItem().appliedNestedStyles,
      step = charStyles.length,
      resString = "";
    
      while ( (cCharStyle = charStyles.pop() ) && step--)
           if ( cCharStyle.length )
                resString = app.selection[0].characters[step].contents + resString;
    
    alert ( resString );
    

    Jarek

  • link to an interactive report AND apply the filter for 2 items.

    Hi can you help me out here on how to create a link to an interactive report AND apply the filter for 2 items.

    Here is my code

    I have a list of table, clicking the selected item should link to interactive report and create the filter. Below the code does not work for a filter. can you help me what to do with 2 filters.

    A filter = > works very well

    sys. HTP.p ("< ul class =" uChartList"> ');

    sys. HTP.p ("< class li =" uNumber uGrid col_2 col_sart"> ');

    sys. HTP.p ("< a href =" "|") sys. HTF.escape_sc ('f? p ='|: APP_ID |': 0 0 :'||: APP_SESSION |':00:P00_XXX:000, RIR:IREQ_XXX:Test :') |) » » >') ;

    sys. HTP.p ("< class =" uValue"> ' | l_tester |) ("< / big >");

    sys. HTP.p ("< small class =" uLabel"> < /small > Tester ');

    sys. HTP.p ("< /a > '");

    sys. HTP.p ("< /li >" ");

    Scenario 2:

    Two filters = > does not

    sys. HTP.p ("< ul class =" uChartList"> ');

    sys. HTP.p ("< class li =" uNumber uGrid col_2 col_sart"> ');

    sys. HTP.p ("< a href =" "|") sys. HTF.escape_sc ('f? p ='|: APP_ID |': 0 0 :'||: APP_SESSION |':00:P00_XXX:000, RIR:IREQ_XXX:Test:P00_YYY:001:IRC_YYY:test2 :') |) » » >') ;

    sys. HTP.p ("< class =" uValue"> ' | l_tester |) ("< / big >");

    sys. HTP.p ("< small class =" uLabel"> < /small > Tester ');

    sys. HTP.p ("< /a > '");

    sys. HTP.p ("< /li >" ");

    Thanks in advance

    actually the syntax wrong values in the syntax of the passes to several elements.

    is

    f? p = 6000:6004: & APP_SESSION. : NO:6003:MY_ITEM1, MY_ITEM2, MY_ITEM3:1234, 5678

    Use above scenario and verification.

    Go

  • Selection of parts and columns, or entire lines and apply the character style

    I am trying to apply character styles to certain parts/whole rows and columns.

    I can change individual cells with the following code...

    table = app.selection[0];
    if (table.hasOwnProperty("baseline")) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Column) table = table.parent;
    if (table instanceof Row) table = table.parent;
    if (table instanceof Table)
    
    {
     table.rows[0].cells[6].texts[0].appliedCharacterStyle = "none report";
     }
    

    ... but when I try to select an entire line, I get the error 'Object does not support property or method' texts. "" "When I try one of the following two codes.

    {
     table.rows[0].cells.texts.appliedCharacterStyle = "none report";
     }
    

    {
     table.rows[0].cells.appliedCharacterStyle = "none report";
     }
    

    Anyone know how I can do the following?

    1. Select any row (or column) and apply the character style

    2. Select the last line (regardless of the number of rows in the table) and apply the character style

    3. apply the character style to specific columns (with theexception of the cells of two albums)

    Thank you!

    Hello

    Change this line:

    table.columns[a].cells.itemByRange(2,-1).texts.everyItem().appliedCharacterStyle = "chart orange";
    

    for the first 2 rows in each column

    Jarek

  • Navigate in the photo when zoomed in and using the mask tool

    Hey guys, I tried to figure out how to move photo when I'm zooming in and using the mask and I can not understand. It's a pain to have clear the Brush tool can pan around, especially when I am trying to add a mask. If someone could help, it would be great. Thank you!

    Space bar.

  • Identify and purge the duplicate files

    I'm running out of storage space. When I look at My Documents & Settings it seems that there is a lot of duplicates and files. Is there a process to identify duplicate files and purge them in Window XP?

    http://www.SnapFiles.com/reviews/AllDup/AllDup.html

    AllDup allows you to find the files duplicated on one or several folders or drives. You can choose to match files by size, date, attributes and content comparison byte by byte and also various settings to exclude certain file types or the search folders. AllDup then analyze selected records and produce a list of all files duplicate was found. The list is organized into groups, which makes it easy to manage results and process the files. You can manually select the files that you consider to be duplicates, or you can use the options of Intelligent selection that allows you to automatically select the files based on their date or folder. Duplicate files can be processed in different ways, you can choose to delete, move or copy them to a different folder or rename them in their current location. Other features include export search results, customized search profiles, a built-in file extract, ID3 tags support and more.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://www.SnapFiles.com/reviews/Auslogics-duplicate-file-Finder/ausdupe.html

    Auslogics Duplicate File Finder helps you to find duplicate files that are likely to be scattered all over your hard drive. The program can compare files based on size, date, content and name. You can select several folders (with Sub-folders) or an entire drive to analyse, specify the methods used to determine the files double and then view the results list and delete files that you no longer need.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    XP forums:

    http://social.answers.Microsoft.com/forums/en-us/category/WindowsXP

    Link above is for XP Forums.

    There is a list of the different Forums XP to the link above to help you.

    You get the help you need there.

    Here is the Vista Forums.

    See you soon

    Mick Murphy - Microsoft partner

  • Select and update the mask of the new cc

    I make a selection using the lasso tool > go to the Select again and the mask. When this window opens, my selection is a party! Tried to go directly to the Select and mask and make the lasso selection, and the moving dotted line disappear until I can feather! What I am doing wrong, please.

    Sheila

    Glad it worked for you...

    Please mark my answer is right

  • Help with a script to search for text in a table cell and apply the cell style

    Hello

    I build the script which Jongware wrote in his post here http://indesignsecrets.com/tackling-tables-through-scripting.php - I am trying to create a variable in which I can add a number of different parts of the text, in this case it's different parts of the United Kingdom i.e. 'London', 'East', 'Scotland' etc. I just need the script to apply the cell Style - 'District Cell' - to any cell that contains text in the variable. Here's the script, if anyone can help I would be grateful.

    function checkWhichTable()
    {
    // ensure the user made a selection
    if (app.selection.length != 1)
    return null;
    var currentTable = app.selection[0];
    if (currentTable.hasOwnProperty("baseline"))
    {
    currentTable = app.selection[0].parent;
    }
    while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column)
    currentTable = currentTable.parent;
    if (!(currentTable instanceof Table))
    {
    // No table selected
    return null;
    }
    return currentTable;
    }
    app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Process Table");
    
    
    function checkUserSelection ()
    {
    var a_table = checkWhichTable();
    if (a_table == null)
    {
    if (confirm("No table selected. Do you want to process *all* tables?") == false)
    return;
    allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
    for (aTable=0; aTable<allTables.length; aTable++)
    {
    processTable (allTables[aTable]);
    }
    } else
    {
    processTable (a_table);
    }
    }
    function processTable(table)
    {
    // do something here!
    
    
    //Find Text in Cell and apply Cell Style
    var textInCell=['London', 'Scotland', 'South West'];
    for (i=0; i<table.cells.length; i++)
    {
    if (table.cells[i].texts[0].contents==textInCell)
    table.cells[i].appliedCellStyle = "District Cell";
    }
    
    
    
    
    }
    

    Hello

    Change this feature:

    function processTable(table)
    {
    //Find Text (exactly as it is) in Cell and apply Cell Style
    var
      textInCell=['London', 'Scotland', 'South West'],
      mFound, cFound;
    
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "^(" + cities.join("|") + ")$";
    mFound = table.findGrep();
    while( cFound = mFound.pop() )
      cFound.parent.appliedCellStyle = "District Cell";
    }
    

    Jarek

  • Update 11.2.0.1 to 11.2.0.2 and apply the patch set update. CARS CARS CARS

    Hi all

    I am new to ORACLE RAC, I just want to know how to install or upgrade existing oracle 11 GR 2 on CARS.

    We have RAC on solaris 10 64-bit. Here is the result of the database instance.

    SQL > SELECT * FROM SYS. V_$ ACTIVE_INSTANCES;

    INST_NUMBER INST_NAME
    ----------- ------------------------------------------------------------
    1 testdev1:DEVT1
    2 testdev2:DEVT2

    So on sever testdev1 whe running instance DEVT1 and break in testdev2 DEVT2 is running.

    Current database version is 11.2.0.1.0... I want to update, or apply the patches 11.2.0.2.0 scheme.

    I want to do the upgrade out of Place (i.e. create new oracle home and install oracle)

    I successufully standalone update DB (No. CARS) but I'm not having experience in the CCR.

    Can you please guide me, or send me the link of the document that I follow to upgrade database RAC 11.2.0.1 to 11.2.0.2.0

    See you soon.

    MOS Doc-things to consider before moving to 11.2.0.2 Grid Infrastructure/ASM [ID 1312225.1]

    Steps to upgrade 11.2.0.1 RAC to 11.2.0.2
    http://abbasocp.blogspot.in/2012/03/steps-to-upgrade-11201-RAC-to-11202.html
    http://askdba.org/weblog/2010/10/steps-to-upgrade-11201-RAC-to-11202/

  • Is it possible to add text to the cells and apply the character style in the cell

    I work in InDesign on Mac 5.

    I have two tables of formatting with information that will be eventually combined. I implemented the scripts I found on these forums to add the columns needed, merge lines and fill the cells merged with the appropriate color, but can't two remaining tasks.

    1. is it possible to add text to a cell of some?

    2 and it is possible to apply a character style to cells? (different cells than those that I need to add some text)

    I played with this code but do not know if it is even close...

    {

    table. Rows [0]. Cells [0]. InsertText (' CS/PS");

    }

    {

    table. Rows [0]. Cells [0] .appliedCharacterStyle ("bold");

    }

    Here are the scripts that I have combined so far for the table...

    Add column

    myTable = app.selection [0];

    MyColumn = myTable.columns [1];

    for (a = 0; < 1; a ++)

    {

    myTable.columns.add (LocationOptions.AFTER, myColumn);

    }

    Merge lines

    table = app.selection [0];

    If (table.hasOwnProperty ("baseline") table) = table.parent;

    If (instanceof cell table) table = table.parent;

    If (instanceof column table) table = table.parent;

    If (instanceof row table) table = table.parent;

    If (instanceof Table table)

    {

    table. Rows [0]. Cells [0]. Merge (table.rows [0] .cells [1]);

    }

    {

    colours alternating in merged lines

    r = table.rows [1];

    n = app.activeDocument.swatches.item ("orange");

    b = app.activeDocument.swatches.item ("PANTONE 3005 C");

    for (c = 0; c < r.cells.length; c ++)

    {

    If (c & 1)

    r.Cells [c]. Properties = {fillColor:b};

    on the other

    r.Cells [c]. FillColor = n;

    }

    }

    Hello

    1. If you want to add the text, go further in:

    table. Rows [0]. Cells [0] .insertionPoints [0] .silence = ' CS/PS;

    2 similar with application of styles:

    table. Rows [0]. Cells [0] .texts [0] .appliedCharacterStyle = "bold" / / If this style is present in your doc

    Jarek

  • Install RAC 11 GR 2 and apply the patches with the new Option of software updates YES

    Anyone tried the installation with the new Option of software updates?

    I'm going to install grid RAC 11 GR 2 and I intend to do the following steps:
    (1) install the Oracle Grid Infrastructure 11.2.0.2 patch group
    (2) make all configurations with YES
    (3) create ASM disks
    (4) install Oracle Database 11.2.0.2 software only
    (5) apply recommended patches 11.2.0.2.2 Oracle (12311357) and 12431716. (Ref. MOS doc [756671.1 ID])
    (6) create the RAC (advanced option) with DBCA database

    With these steps:
    Grid and ASM disks would be configured without the recommended patches, but the database will be created with applied patches.

    I would not do a "Software only" install IM and then apply the patches because later I would have to manually do all the configuration steps.

    If I use the Option of YES software updates to apply patches, YES makes the adjustment, and then I would set up the GRID with YES?

    Quote from Oracle® Setup Guide Network Infrastructure 11 g Release 2 (11.2) for Linux - E17212 number of part-11:
    'Use the feature of dynamic download and apply software upgrades of software updates as part of the installation of the Oracle database. You can also download updates separately using the downloadUpdates option and later to apply during installation by providing the location where updates. »

    I could not find more detailed information on this feature in the documentation and MOS.

    Thank you

    Hello

    You can download the latest updates and patches to help with option - downloadUpdates

    ./runInstaller -downloadUpdates
    

    You can use this note:

    * How to download the latest updates and patches using 11.2.0.2 YES [ID 1295074.1] *.

    Don't miss...
    * Error: INS-20704 while installation 11.2.0.2 with Option 'use downloaded software updates' [1265270.1 ID] *.
    : Note ensure that the user download the updates of patches have own/correct permission to download updates to patch to MOS (My Oracle Support).
    Do not use the directories/tmp/oraInstall * for the download location. New bug 9975999

    Documentation explaining...
    4.5.1 running Oracle Universal Installer
    Download of updates before Installation
    http://download.Oracle.com/docs/CD/E11882_01/install.112/e16763/inst_task.htm#BABJGGJH

    Kind regards
    Levi Pereira

  • Find the text and apply the format paragraph tag in Framemaker 11

    Help!

    I am trying to automate the search text in a file FM11 and CE marking with a specific paragraph tag. Once it is, I want to be able to search for the same string again and delete it. The research will include wildcard characters. I'm moving Word files on and bring with manual numbering of paragraphs. Thus, when they arrive, they "2.3.4.5" before paragraphs for example. I want to search all of the numbers at the beginning of paragraphs, tag all those with the appropriate para format (starting a catalog) and then remove the manual numbering.

    At this time do us it manually, using find/replace and by using wildcard search strings to find (such as '\P[1-9]*.*.*.*[0-9]', which will find all the para numbering at the beginning of a paragraph 4-digit), then using the change option to paste to paste in a paragraph of the catalog tag. Then we repeat the same search and delete the text, leaving only the tag para to the number format. It works very well, but errors can occur if the search string in set incorrectly or if the numbers are not deleted (in this case, it is found on the next search and re-labeled incorrectly). For example

    I work for the Air Force collection of entries from the field and creating publications out of them, so there is no mobile profit here, just trying to be efficient. Any help is greatly appreciated!

    Thanks in advance

    b

    Hi Brian,.

    I guess right here because I've never done this before, but... In my view, there is definitely something wrong with your mission to find the property values. The way you wrote, you are trying to assign two properties to a single table space. That's why you need to remove these two lines to make him find work, because they are replacing the FindText property apparently. Here is my proposal for how it should be:

    findParams = AllocatePropVals (2);

    findParams [0].propIdent.num = Constants.FS_FindText;

    findParams [0].propVal.valType = Constants.FT_String;

    findParams [0].propVal.sval = searchString.

    findParams [1].propIdent.num = Constants.FS_FindCustomizationFlags;

    findParams [1].propVal.valType = Constants.FT_Integer;

    findParams [1].propVal.ival = Constants.FF_FIND_USE_WILDCARDS;

    In any case, let me point out again once it is a hypothesis and I did not test this. I am sure, however, that the solution is somewhere along this path.

    Russ

Maybe you are looking for

  • Pavilion HP G62: ERASE win7 home reinstalled win7pro 64 32

    Try to clear win 7 home 32 bits without success I have change my hard drive the a collapst old. Win 7home was istall by hp what is the procedure to remove the 32-bit reinstalled win 7 pro 64-bit

  • App stuck on waiting. What is the problem with 9.3?

    I don't have this problem with 9.2.1 but now my new apps that I try to download I get stuck on the waiting and I have to restart my iPhone back in the App Store and restart the download to make it work. What should I do? PS. the two wifi and 4G works

  • How can I disable the cartridge on my HP officejet printer protection 8600?

    Hello I read that the officejet 8600 has a cartridge protection feature that can be disabled through the Toolbox. I have been through all the settings in the printer of his auto tools and can not find, I also have trawled through all kinds of HP stuf

  • My screen turns on but it shuts down in seconds.

    My monitor worked fine, but suddenly when I turn it on it starts up but is not well away from let it connect so it will turn off by itself. What could be the problem!

  • Need win 7 driver for PERC 9 Mini h330

    I need to install Win 7 64 on a workstation Precision Rack 7910. The SP1 installation disc is not a driver for the RAID controller.  Download of 7910 page support is an exe file that is not recognized and won't let me extract the driver to copy. I co