Ignore the error

I have this simple script (action converted to java) which renames a 'Test' to 'H_Test' layer "that duplicates with the name"B_Test"

There is an additional line of code I can include to skip this process, if the name of the layer 'Test' does not appear in the list of layers?

Thank you very much!

#target photoshop

//

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

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

//

= Select_byName_AddPrefix_Duplicate =.

//

function Select_byName_AddPrefix_Duplicate() {}

Select

function step 1 (enabled, withDialog) {}

If (enabled! = undefined & &! activated)

return;

var dialogMode = (withDialog? DialogModes.ALL: DialogModes.NO);

var desc1 = new ActionDescriptor();

var ref1 = new ActionReference();

Ref1.putName (cTID ("'Lyr"), 'Test');

DESC1.putReference (cTID ('null'), ref1);

DESC1.putBoolean (cTID ('MkVs'), false);

executeAction (desc1 cTID ('slct'), dialogMode);

};

Set

step2 function (activated, withDialog) {}

If (enabled! = undefined & &! activated)

return;

var dialogMode = (withDialog? DialogModes.ALL: DialogModes.NO);

var desc1 = new ActionDescriptor();

var ref1 = new ActionReference();

Ref1.putEnumerated (cTID ('Lyr'), ('Ordn') cTID, cTID ('Trgt'));

DESC1.putReference (cTID ('null'), ref1);

var desc2 = new ActionDescriptor();

desc2.putString (cTID ('Nm'), 'H_Test');

DESC1.putObject (cTID ('), ('Lyr') cTID, desc2);

executeAction (desc1 cTID ('setd'), dialogMode);

};

Two copies

Step 3 the function (activated, withDialog) {}

If (enabled! = undefined & &! activated)

return;

var dialogMode = (withDialog? DialogModes.ALL: DialogModes.NO);

var desc1 = new ActionDescriptor();

var ref1 = new ActionReference();

Ref1.putEnumerated (cTID ('Lyr'), ('Ordn') cTID, cTID ('Trgt'));

DESC1.putReference (cTID ('null'), ref1);

DESC1.putString (cTID ('Nm'), 'B_Test');

DESC1.putInteger (cTID ('VR'), 2);

executeAction (desc1 cTID ('Dplc'), dialogMode);

};

Step1();      Select

Step2();      Set

step3();      Two copies

};

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

Select_byName_AddPrefix_Duplicate.main

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

//

Select_byName_AddPrefix_Duplicate.main = function () {}

Select_byName_AddPrefix_Duplicate();

};

Select_byName_AddPrefix_Duplicate.main ();

EXPRESSIONS OF FOLKLORE

'Select_byName_AddPrefix_Duplicate.jsx '.

EXPRESSIONS OF FOLKLORE

Hello

simplest is to encapsulate the step 1 in a try/catch block.

#target photoshop
//

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

//
//==================== Select_byName_AddPrefix_Duplicate ==============
//
function Select_byName_AddPrefix_Duplicate() {
  // Select
  function step1(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putName(cTID('Lyr '), "Test");
    desc1.putReference(cTID('null'), ref1);
    desc1.putBoolean(cTID('MkVs'), false);
    executeAction(cTID('slct'), desc1, dialogMode);
  };

  // Set
  function step2(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
    desc1.putReference(cTID('null'), ref1);
    var desc2 = new ActionDescriptor();
    desc2.putString(cTID('Nm  '), "H_Test");
    desc1.putObject(cTID('T   '), cTID('Lyr '), desc2);
    executeAction(cTID('setd'), desc1, dialogMode);
  };

  // Duplicate
  function step3(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
    desc1.putReference(cTID('null'), ref1);
    desc1.putString(cTID('Nm  '), "B_Test");
    desc1.putInteger(cTID('Vrsn'), 2);
    executeAction(cTID('Dplc'), desc1, dialogMode);
  };

  try {
    step1();      // Select
  } catch(e) {
    return;
  }
  step2();      // Set
  step3();      // Duplicate
};

//=========================================
//                    Select_byName_AddPrefix_Duplicate.main
//=========================================
//

Select_byName_AddPrefix_Duplicate.main = function () {
  Select_byName_AddPrefix_Duplicate();
};

Select_byName_AddPrefix_Duplicate.main();

// EOF

"Select_byName_AddPrefix_Duplicate.jsx"
// EOF

Concerning

Davide Barranca

---

www.davidebarranca.com

www.cs-extensions.com

Tags: Photoshop

Similar Questions

  • How to ignore the error S.M.A.R.T. for El Capitan update?

    I have a disc with a Smart error. In my particular case, I know that it is relatively safe to continue to use my drive. I have error SMART attribute #173 (level of wear), but all these block replaced is arrived in the small volatile temp score, my main system partition is sure. In short, I know what I'm doing.

    I want to ignore this error and to force the update. How to do this?

    If you think it's worth, you can try to format the drive. I don't know any way to force the installer to ignore the error.

  • Simple Handler.vi error ignores the error code?

    I'm trying to understand the behavior of Simple Error Handler.vi, and it confuses me because it seems not be properly error code I give.

    According to the documentation, if I have an error code, then:

    If error in indicates an error, the VI ignores the error code. If this is not the case, the VI it tests. A nonzero value means a mistake.

    But my observation is that when the error indicates an error, the VI always shows a dialog even when given an error code. Instead, I use the Handler.vi to General error and providing an exception action (cancel error on match) and an exception code to get the behavior I want.

    What am I misunderstanding?

    MacNorth wrote:

    I'm trying to understand the behavior of Simple Error Handler.vi, and it confuses me because it seems not be properly error code I give.

    According to the documentation, if I have an error code, then:

    If error in indicates an error, the VI ignores the error code. If this is not the case, the VI it tests. A nonzero value means a mistake.

    But my observation is that when the error indicates an error, the VI always shows a dialog even when given an error code.

    There are two ways of interpreting unaware them in the sentence: "If the error indicates an error, ignore them error codeVI."

      1. (the intention) If the error indicates an error, the VI does not use the error code.

      2. (my point) If the error indicates an error, the VI deletes all corresponding to the error code.

  • How to ignore the error in adpatch?

    Hello
    I'm new to adpatch... an error occurred while adpatch... adpatch said to correct the problem, so that the handler can continue... but metalink told to ignore this error... can someone give me how to stop adpatch and ignore the error? Please give me the procedure

    Hello

    This is the link that tells me to ignore the error...

    https://support.Oracle.com/CSP/main/article?cmd=show&type=not&DOCTYPE=problem&ID=1066653.1

    That's what shows... IMPOSSIBLE: folder jtfdiagresp.ldt worker 3.

    What should I do with this worker

    If the case is applicable to you, then start a new session user applmgr, source of the env file and issue "adctrl" application, then select (Option 8 - hidden option) and say the failed worker (worker 3) to ignore the work.

    Thank you
    Hussein

  • Ignore the error and continue the pl/sql block

    Dear all,

    Please help me to fix the script below.

    I had an obligation to write a pl/sql that will handle the update instructions.

    For example:
    A table that contains 10 rows of data. Through pl/SQL block, I update the 10 rows (or a smaller number of lines).
    Now, the scenario is by updating registration / line 4, oracle has met an error and then oracle leave pl/sql block and cancel the transaction.

    My requirement here is, by updating the records, if oracle encounters an error, it must raise an error or ignore the record and continue to process records. Oracle wouldn't pl/sql block.

    We are using oracle 10g.

    Thank you
    KODS

    As has already been suggested, you might check DML ERROR LOGGING

  • MODBUS RTU read how to ignore the error

    Hello

    I have a problem, how to jump when the error of communication if I use the Modbus Library? I want this as smoothly without error on the chart.

    Look at this video I save my problem:

    https://drive.Google.com/file/d/0B_94Z4CwsTYeWEJpZUx2cVJ0a2c/edit?USP=sharing

    I tried to mod on MB series Master query Read Input Register.vi using the box Structure in case of error. See this video and still did not work. any suggestion?

    Thank you ~.

    You put the error structure in the evil VI.

    Put it in the main VI and table inside the no error case.

    When you have it in the Subvi, the Subvi should always return something.  If it returns is your data when it is not an error because you put the indicator in the case of error no..  Or if there is an error, it returns the default for the indicator data because you're not write all data on it.

  • Ignore the digital error, with the EXCEPTION

    Hello

    I have a PROC that reads all of the records from one table and INSERT them into another table, quite simple. The only thing is I want to IGNORE digital errors. So, if a get a (digital) mistake, I want Oracle to IGNORE the error and continue in my FOR LOOP (Selecting records) and the insertion in the table. What seems to happen, is that if I get a DIGITAL error, it exits the for... Here is the Code:
      PROCEDURE Insert_Current_Data(
       p_create_date                 IN         DATE,
       p_StatusId                      OUT      NUMBER
    ) IS
     e_constraint_error               EXCEPTION;
     e_numeric_error                 EXCEPTION;
       PRAGMA EXCEPTION_INIT (e_constraint_error, -2291);
       PRAGMA EXCEPTION_INIT (e_numeric_error, -1722);   
    /*   to_number(NOC_CODE) NOC_CODE,
                      to_number(ECONOMIC_REGION_CODE) ECONOMIC_REGION_CODE, */
    CURSOR ei_claimant_ext_cur
          IS
          SELECT NOC_CODE,
                      ECONOMIC_REGION_CODE,
                      CASE EI_PROV_CODE
                        WHEN '00' THEN 1
                        WHEN '01' THEN 4
                        WHEN '02' THEN 2
                        WHEN '03' THEN 3
                        WHEN '04' THEN 5
                        WHEN '05' THEN 6
                        WHEN '06' THEN 7
                        WHEN '07' THEN 8
                        WHEN '08' THEN 9
                        WHEN '09' THEN 10
                        WHEN '10' THEN 11
                        WHEN '11' THEN 12
                        ELSE 13
                      END EI_PROV_CODE,
                      POSTAL_CODE
            FROM ei_claimant_external
            WHERE ei_prov_code <> 12
            AND     economic_region_code <> 99
            AND     postal_code is NOT NULL;
    --        AND     ROWNUM < 1000;
            
            ei_claimant_ext_rec ei_claimant_ext_cur%ROWTYPE;
            
            v_create_date       VARCHAR2(20);
            
            v_econ_reg_prov     NUMBER;
            
        BEGIN
               
         dbms_output.put_line('Date passed: '||p_create_date);  
         dbms_output.put_line('INSERT Current Data '); 
    
    --        p_StatusId := 0;
    
            FOR claimant_row IN ei_claimant_ext_cur LOOP
    
    /*        OPEN ei_claimant_ext_cur;
            
            LOOP
      
                FETCH ei_claimant_ext_cur 
                INTO ei_claimant_ext_rec;
        
                -- v_staging_count := v_staging_count + 1;
                
                EXIT WHEN ei_claimant_ext_cur%NOTFOUND;      */
                
                BEGIN
                
                    --- Get Econ Region Province
                    SELECT PROVINCE_ID
                    INTO     v_econ_reg_prov
                    FROM    cd_econ_regions
                    WHERE  ECONOMIC_REGION_ID = ei_claimant_ext_rec.ECONOMIC_REGION_CODE;
                    
                EXCEPTION
                    WHEN NO_DATA_FOUND THEN v_econ_reg_prov := 0;
                END;
                
                
                BEGIN
                              
                    IF v_econ_reg_prov = ei_claimant_ext_rec.EI_PROV_CODE
                    THEN 
                        INSERT INTO ei_claimant_curr_year
                        VALUES  (EI_SEQ.nextval,
                                ei_claimant_ext_rec.noc_code,
                                ei_claimant_ext_rec.EI_PROV_CODE,                            
                                ei_claimant_ext_rec.ECONOMIC_REGION_CODE,
                                p_create_date, --- CURRENT Month 
                                ei_claimant_ext_rec.POSTAL_CODE
                                );
                                COMMIT;
                    END IF;                                                          
    
                EXCEPTION
                    WHEN e_constraint_error THEN dbms_output.put_line('CONSTRAINT Error '); 
                            fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                            ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                                  SQLCODE,
                                  NULL,
                                  'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                                 );
                    WHEN e_numeric_error THEN dbms_output.put_line('NUMERIC Error On INSERT'); 
                            fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                            ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                                  SQLCODE,
                                  NULL,
                                  'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                                 );                                   
                    WHEN OTHERS
                        THEN
    
                            fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                            ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                                  SQLCODE,
                                  NULL,
                                  'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                                 );          
                END;
                
            END LOOP;
        
    --        CLOSE ei_claimant_ext_cur;        
    
        EXCEPTION
                        WHEN e_constraint_error THEN dbms_output.put_line('CONSTRAINT Error '); 
                            fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                            ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                                  SQLCODE,
                                  NULL,
                                  'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                                 );
                        WHEN e_numeric_error THEN dbms_output.put_line('NUMERIC Error ON Cursor'); 
                            fwutil_pkg.logerror (SQLERRM||' '||ei_claimant_ext_rec.noc_code||' Prov Code: '||ei_claimant_ext_rec.EI_PROV_CODE||'  Econ Region: '||ei_claimant_ext_rec.ECONOMIC_REGION_CODE||
                            ' Postal Code: '||ei_claimant_ext_rec.POSTAL_CODE||' Date: '||p_create_date,
                                  SQLCODE,
                                  NULL,
                                  'Populate_EI_Claimant_Main -- Insert into EI_Claimant_curr_year '
                                 );               
                                         
        END Insert_Current_Data;
    Here are reports that it is currently reading:
    00094440903E4P1T5
    00000000000000000
    00066230703E1E1G4
    AAAAAAAAAAAAAAAAA
    00012210903E4K2K8
    00082620803E5V1L3
    99999999999999999
    00084410803E5G2J3
    00074120903E4N2E3
    -----------------
    00094630903E4N1B7
    00082620903E4N2J6
    )))))))))))))))))
    00082620903E4M2C4
    It inserts the first 2 records, ignoring the record with "0" (which is good). Then, he leaves the LOOP for when it happens to registration with a bunch of "A."


    Help, please!

    Thanks in advance.

    First fix your code... FOR THE LOOP has not been implemented correctly... I think that u first tried with SLIDER OPEN... LOOP... PICK UP... WHEN THE OUTPUT... END OF LOOP... CLOSE THE CURSOR... then the same LOOP FOR converted... END LOOP and I forgot to change the code like
    -WHERE ECONOMIC_REGION_ID is ei_claimant_ext_rec. ECONOMIC_REGION_CODE;.

    Try this type of code...

    DECLARE
    Mixed_typ TYPE IS a TABLE OF VARCHAR2 (1)
    INDEX BY PLS_INTEGER;

    mixed_ty mixed_typ;
    e_numeric_error EXCEPTION;
    PRAGMA EXCEPTION_INIT (e_numeric_error,-6502);
    v_num NUMBER;
    BEGIN
    mixed_ty (1): = '1';
    mixed_ty (2): = 'A ';
    mixed_ty (3): = '2';
    mixed_ty (4): = '3';
    BECAUSE me in 1... mixed_ty. COUNTING LOOP
    BEGIN
    v_num: = TO_NUMBER ('11' | mixed_ty (i));
    DBMS_OUTPUT. Put_line (v_num);
    EXCEPTION
    WHEN e_numeric_error THEN
    DBMS_OUTPUT. Put_line (' ignore ' |) SQLERRM);
    END;
    END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. PUT_LINE (SQLERRM);
    END;

  • What is the error console

    What is the use of the error, the web console, notebook, console

    Web developers which allows to check of the site to find errors. You can ignore the errors in the Console error as a normal user.

  • I've removed a virus, but cannot update windows now I get the error no. 0 x 80070424.

    I tried the solution of Micrsoft of manually The on updates, but still nothing.

    This is almost certainly due to someone having tampered with the services involved in the WGA process.

    Run the MGADiag tool

    To analyze and solve problems for Activation and Validation, we need to see a full copy of the report produced by the MGADiag (download and save to the desktop - http://go.microsoft.com/fwlink/?linkid=52012 ) tool
    Once saved, run the tool.
    Click on the button continue, which will produce the report.
    To copy the report in your response, click the button copy in the tool (ignore the error at this stage), and then paste (using r-click and paste or Ctrl + V) in your response.

  • When I activate my windows 7 Home Premium its gives me the error.

    The error code is 0xC004C008. Can someone help me. ?

    And also, this shows the id of the product has expired why so...?

    probably, you need to activate by phone:

    How to activate Windows 7 manually (activate by phone)

    1) click Start and in the search for box type: slui.exe 4

    (2) press the ENTER"" key.

    (3) select your "country" in the list.

    (4) choose the option "activate phone".

    5) stay on the phone (do not meet all the automatic guests) and wait for a person to help you with the activation.

    (6) explain your question clearly to the support person.

    If this does not work:

    To analyze and solve problems for Activation and Validation, we need to see a full copy of the diagnostic report produced by the MGADiag tool (download and save to the desktop - http://go.microsoft.com/fwlink/?linkid=52012 )

    Once downloaded, run the tool.

    Click on the button continue, after a short time, continue button will change to a copy button.

    Click the copy button in the tool (ignore the error at this stage) and then paste (with r-click and paste or Ctrl + V) in your message. (please do not change the report.)

  • How can I solve the error message I'm not authentic Windows?

    I had to replace the hard drive on my laptop of HP because it wouldn't start. I restored my system from a complete image of the system using Norton Ghost. Now, I am constantly the following error screen:

    When I try to fix the error, and I download the required file, I get the following error:

    How can I fix it, because I fear that my system is locked in. The laptop computer was purchased with Windows Vista preloaded, which has been updated to Windows 7 with the disc provided by Microsoft.

    To analyze and solve problems for Activation and Validation, we need to see a full copy of the diagnostic report produced by the MGADiag tool (download and save to the desktop - http://go.microsoft.com/fwlink/?linkid=52012 )

    Once downloaded, run the tool.

    Click on the button continue, after a short time, continue button will change to a copy button.

    Click the copy button in the tool (ignore the error at this stage) and then paste (with r-click and paste or Ctrl + V) in your message. (please do not change the report.)

  • VM in ignorant hard error auto start

    Hello, I looked for something in the community, on the vmware site and on the web, but I found nothing

    I have a VM from esxi5.5 (win2012) with a virtual disk (not the system, just partition partition file sharing) on a raid0 for simple storage (a sas drive). I need a few days to take off that disk and the power on the host (HPproliant360) making esxi auto start the virtual machine by ignoring the error on the missing vmdk.

    any suggestion or address would be much appreciated

    Thank you

    There is no way to skip vmdk-missing-errors.
    You can set only temporarily
    scsiX:Y.present = "false".
    in the vmx file

  • ORA-31693: Data Table object 'AWSTEMPUSER '. "' TEMPMANUALMAPRPT_273 ' failed to load/unload and being ignored because of the error:

    Dear all,

    OS - Windows server 2012 R2

    version - 11.2.0.1.0

    Server: production server

    ORA-31693: Data Table object 'AWSTEMPUSER '. "' TEMPMANUALMAPRPT_273 ' failed to load/unload and being ignored because of the error:

    ORA-02354: Error exporting/importing data

    ORA-00942: table or view does not exist

    When taken expdp and faced error mentioned above. but expdp completed successfully with waring as below.

    Work "AWSCOMMONMASTER". "" FULLEXPJOB26SEP15_053001 "finished with 6 errors at 09:30:54

    (1) what is the error

    (2) is there any problem in the dump because file as above of the error. If Yes, then I'll resume expdp.

    Please suggest me. Thanks in advance

    Hello

    I suspect that what has happened, is that demand has dropped a temporary table to during the time that you run the export - consider this series of events

    (1) temp table created by application

    (2) start expdp work - including this table

    (3) the extracted table metadata

    (4) the application deletes the table

    (5) expdp is trying to retrieve data from the table - and gets the above error.

    Just to confirm with the enforcement team that the table is just a temporary thing - it certainly seems it name.

    See you soon,.

    Rich

  • ignore the insert errors in a merge statement?

    Hi all

    I wonder if it is possible, somehow, to ignore the failings of the insert statement in a merge statement of bulk? The error encountered is the violation of a primary key. What is happening is that the different transactions share the same plsql procedure. Therefore, it could happen that different transactions will try to insert two rows with the same primary key.

    MERGE INTO table
    Using the collection
    WE (table.id = collection.id)
    WHEN MATCHED THEN
    UPDATE...
    WHEN NOT MATCHED THEN
    INSERT...-> it may fail for duplicates here

    The only solution would be to use 'updated massive day + bulk insert (ignore errors)' instead of a merger in bulk?

    Any help is very appreciated,
    WF

    What about using [DML Error Logging | http://www.oracle-base.com/articles/10g/DmlErrorLogging_10gR2.php#merge]?

  • Apple Software update for windows stop working after 2.2? updated in date dated March 10,2016. Do not install! I had to reinstall and ignore the update to get it working again

    I guess my computer Windows 10 cannot speak on the new secure server this update tries to connect to. For now, I just went and reinstalled and ignored the 2.2 update or anything like that. The difficulty of this Apple. What did your so-called security update is breaking the Apple software update.

    I did the update when it appeared and it worked well for me. I even used it to update iTunes earlier this week, but this morning noticed the same error on two machines. Clearly question server side of Apple, they need to fix

Maybe you are looking for