How do I automate merging multiple layers with same name?

It was suggested I ask this question in this forum - any advise gratefully received!
I have to combine over a 800 files into one photoshop file. Each file has with sixty layers. The 60 layers in each file are named identically: Layer 1, Layer 2, Layer 3 up to Layer 59, Layer 60. My intention is to create a final composite file with 60 merged layers (for an animation). That is, with all the Layer 1's merged, all the Layer 2's merged, all the Layer 3's merged and so on. What I need is a script which will merge all layers with the same layer name, ie all the Layer 1s, all the Layer 2s etc (ideally without having to merge each set of layers separately).
I am using Photoshop CS6 and at present I am merging by using the find/name function, then highlighting all the layers selected and then using 'merge layers'.
Any ideas?
Best
JR

This might be close, it will prompt for a folder containing all the 800 files, it will use tif or psd files.
Once you have selected the folder sit back and watch...
#target photoshop
app.bringToFront();
main();
function main(){
selectedFolder = Folder.selectDialog( "Please select input folder");
if(selectedFolder == null) return;
var fileList = selectedFolder.getFiles(/\.(tif|psd)$/i);
open(fileList[0]);
checkBackGround();
setLayersVisOn();
for(var z = 1;z<fileList.length;z++){
    open(fileList[z]);
    checkBackGround();
    setLayersVisOn();
    dupLayers(app.documents[0].name);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
if(z % 9 == 0) mergeSameNamedLayers();
mergeSameNamedLayers();
function checkBackGround(){
activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-1];
if(activeDocument.activeLayer.isBackgroundLayer){
    activeDocument.activeLayer.name=activeDocument.activeLayer.name;
function twoOrMoreSelected(){
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) )  return true;
return false;
function mergeSameNamedLayers(){
//Get a list of the layer names
var layerNameList = getNamesPlusIDs();
//create an array for unique layer names
var uniqueName = new Array();
for(var s in layerNameList){
    if(layerNameList[s][2] == "false") uniqueName.push( layerNameList[s][1].toString());
//now we should have unique layer names
uniqueName = UniqueSortedList( uniqueName ).sort();
//select all layers with the same name, merge them and set blendmode
var BlendMode = new String();
for ( var w in uniqueName){
    deselectLayers();
    for(var z in layerNameList){
        if(uniqueName[w].toString() == layerNameList[z][1].toString()){
            //select these layers and get blendmode.
            BlendMode = layerNameList[z][3].toString();
            selectLayerById(Number(layerNameList[z][0]), true);
if(twoOrMoreSelected()) activeDocument.activeLayer.merge();
        setBlendMode(BlendMode);
function setBlendMode(blendMode) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc.putReference( charIDToTypeID('null'), ref );
var desc2 = new ActionDescriptor();
desc2.putEnumerated( charIDToTypeID('Md  '), charIDToTypeID('BlnM'), stringIDToTypeID(blendMode) );
desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc2 );
executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
function deselectLayers() {
    var desc01 = new ActionDescriptor();
        var ref01 = new ActionReference();
        ref01.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc01.putReference( charIDToTypeID('null'), ref01 );
    executeAction( stringIDToTypeID('selectNoLayers'), desc01, DialogModes.NO );
function UniqueSortedList(ArrayName){
var unduped = new Object;
for (var i = 0; i < ArrayName.length; i++) {  
unduped[ArrayName[i]] = ArrayName[i];
var uniques = new Array;for (var k in unduped) {
   uniques.push(unduped[k]);}
return uniques;
function selectLayerById(ID, add) {
    add = (add == undefined)  ? add = false : add;
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), ID);
var desc = new ActionDescriptor();
desc.putReference(charIDToTypeID('null'), ref);
if (add) {
  desc.putEnumerated(stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelection'));
desc.putBoolean(charIDToTypeID('MkVs'), false);
executeAction(charIDToTypeID('slct'), desc, DialogModes.NO);
function dupLayers(DocName) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
desc.putReference( charIDToTypeID('null'), ref );
var ref2 = new ActionReference();
ref2.putName( charIDToTypeID('Dcmn'), DocName);
desc.putReference( charIDToTypeID('T   '), ref2 );
desc.putInteger( charIDToTypeID('Vrsn'), 5 );
executeAction( charIDToTypeID('Dplc'), desc, DialogModes.NO );
function selectAllLayers() {
    var desc29 = new ActionDescriptor();
        var ref23 = new ActionReference();
        ref23.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
    desc29.putReference( charIDToTypeID('null'), ref23 );
    executeAction( stringIDToTypeID('selectAllLayers'), desc29, DialogModes.NO );
function setLayersVisOn(){
   var ref = new ActionReference();
   ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
   var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
try{
    activeDocument.backgroundLayer;
var i = 0; }catch(e){ var i = 1; };
   for(i;i<count;i++){
        ref = new ActionReference();
        ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
        var desc = executeActionGet(ref);
        var layerName = desc.getString(charIDToTypeID( 'Nm  ' ))
        if(layerName.match(/^<\/Layer group/) ) continue;
        if(!desc.getBoolean(stringIDToTypeID('visible'))){
            var list = new ActionList();
            list.putReference( ref );
            desc.putList( charIDToTypeID('null'), list );
            executeAction( charIDToTypeID('Shw '), desc, DialogModes.NO );
function getNamesPlusIDs(){
   var ref = new ActionReference();
   ref.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
   var count = executeActionGet(ref).getInteger(charIDToTypeID('NmbL')) +1;
   var Names=[];
try{
    activeDocument.backgroundLayer;
var i = 0; }catch(e){ var i = 1; };
   for(i;i<count;i++){
       if(i == 0) continue;
        ref = new ActionReference();
        ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
        var desc = executeActionGet(ref);
        var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
        var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
        if(layerName.match(/^<\/Layer group/) ) continue;
        var layerType = typeIDToStringID(desc.getEnumerationValue( stringIDToTypeID( 'layerSection' )));
         desc.hasKey( stringIDToTypeID( 'smartObject' ) )  ?  SO = true :  SO=false;
         var blendmode = typeIDToStringID(desc.getEnumerationValue( stringIDToTypeID( 'mode' )));
Names.push([[Id],[layerName],[SO],[blendmode]]);
return Names;

Similar Messages

  • Mounting multiple directories with same name on different severs to a single mount point on another server

    We have a requirement where in we have multiple solaris servers and each solaris server has a directory with the same name.
    The files in these directories will be different.
    These same name directories on multiple severs has to be mounted to a single directory on another sever.
    We are planning to use NFS, but it seems we can not mount multiple directories with same name on different severs to a single mount point using NFS, and we need to create multiple mount points.
    Is there any way we can achieve this so that all the directories can be mounted to a single mount point?

    You can try to mount all these mount points via NFS in one additional server and then export this new tree again via NFS to all your servers.
    No sure if this works. If this works, then you will have in this case just an additional level in the tree.

  • How to send notifications to multiple person with same role and with result

    How to send notifications to multiple people with resultout as approve/reject?
    We are looping the notification by attaching a cursor query to find the different emp nos to send for approval.
    I cannot associate a role because these emp nos are sub-set of a role which I have created and i am getting thru the cursor query.
    For FYI notification there is no problem, but for approval notification, I am not unable to send approval notifications to all the people.It stops at the first person in the loop.Pls suggest alternate way. Thanks in advance.

    Manju,
    I would use the cursor to populate the API for creating an ad-hoc role within the workflow process as a function. Then set your notification performer as the ad-hoc role.
    Here is an example function:
    create or replace procedure sample_emp_fill(itemtype in varchar2,
    itemkey in varchar2,
    actid in number,
    funcmode in varchar2,
    resultout in out varchar2) as
    cursor get_name is
    select ename from scott.emp where mgr = 7839 and empno != 7566;
    role_name varchar2(50);
    names varchar2(500);
    begin
    if (funcmode = 'RUN') then
    role_name := 'ad_hoc_role_'|| itemkey;
    for row in get_name loop
    names := names || row.ename || ' ';
    end loop;
    WF_DIRECTORY.CreateAdHocRole( role_name=>role_name,
    role_display_name=>role_name,
    language=>'AMERICAN',
    territory=>'AMERICA',
    role_description=>role_name,
    notification_preference=>'QUERY',
    role_users=>names,
    email_address=>' ',
    fax=>'',
    status=>'ACTIVE',
    expiration_date=>'');
    resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
    return;
    end if;
    end;

  • How can I automatically create the files with serie-name?

    Hello, Everyone,
    I have a question again.
    How can I automatically create the file with a serie-filename?
    e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
    How can I do it?`
    Thanks a lot.
    Regarts,
    Johnny

    Hi Deepu,
    one more comment
    The format code should be "%04d" to get leading zeros and have filenames with same length...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to get Unique calid for users with same name in multiple domain env..

    I found we need to use "-k legacy" option for creating users in non-hosted setup..
    I had two domains default as xxxx.com and the one that I created as yyyy.com
    When I have users with same name in two of the domains as user1..
    The calid for both of them is... user1 ....so they share the same calendar
    When Im in valid SSO of yyyy.com I get the mail account for user1 as [email protected] .....but the calid .. common as user1
    How I can get unique calid for users under two domains..
    whether I need to set Hosted domain support...Then how the mailid's differ with out using hosted domain support..
    And I need to login UWC without using @domain.com...
    Help me on this...
    Ashik

    Do you have UWC and Cal configured at least for virtual domain support?
    basically.. for discussion.. let's say you have three domains on your server.. 1st domain is the default domain. other 2 domains are virtual domains.
    if all domains were created with mail and cal support (-S mail,cal).. you would use the following options when creating users:
    1) for the default domain.. you must use the "-k legacy" option when adding users.
    2) for the other two domains.. when you create the user.. do NOT use a "-k" option.
    If you do not use the "-k" option.. it defaults to "hosted" which will cause the user's calid to be [email protected]
    If you Do use the "-k legacy" option.. it will create the calid as just "userid"
    With regard to logging into UWC without the @domain.com part of a username in a hosted domain.. the easiest way to avoid this.. is to point a host name under the hosted domain to the server.
    if you point webmail.xxxx.com to the server... and then access it via:
    http://webmail.xxxx.com/uwc/
    any users in the xxxx.com hosted domain will NOT need to use @xxxx.com when logging in... they can just use "userid"
    This feature does not take any special configuration (aside from adding a DNS entry for the hosted domain)
    Hopefully that helps.

  • Differentiating layers with same name using script

    Hi,
    In Illustrator, different layers can have the same name. Is there any unique identifier to differentiate between the layers having same name? Photoshop assigns an id to each layer. But in Illustrator I could not find any such property. I need to be able to extract some unique identifier for layers in Illustrator using scripting. Any help would be appreciated.
    Thanks.

    Hi Steve,
    I am aware that users can assign any name to layers and that's exactly where I am facing the issue, Layer names can be duplicate and I am at a unable to find a unique identifier for layers. I am looking for a layer property that can serve as the unique identifier. It is really urgent and am stuck with this issue,. Hope I am able to communicate the problem

  • Merging Log Files with same name

    Hello,
    I have log files with same name 00000000.jdb (because created at different machines). I would like to merge data stored in these two files.
    I tried below approaches which do not work:
    1. rename one of the files -> doesn't work as file header has file name info which doesn't match with renamed value
    2. db dump/load -> dump and load works without error. (i have to dump Entity related Database and Format related Database -- from -l option) However when i try to read the file, it gives error.
    Exception in thread "main" com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) Catalog could not be refreshed, may indicate corruption, errorFormatId=52 nFormats=51, . UNEXPECTED_EXCEPTION: Unexpected internal Exception, may have side effects.
    I am using EntityStore and thus Annotated Entities.
    Does any one has any insights?
    Thanks.

    Yuvaraj,
    As you discovered, it is not possible to use .jdb files from one environment in a different environment.  The .jdb files use an internal format with relationships between files that form the Btree.
    I'm glad to hear you were able to use DbDump and DbLoad successfully.
    --mark

  • Multiple files with same name--- automatic renaming option??

    I am trying to sort my files by adding multiple files to a single folder. However, many have the same filename, and I get the error " there already exists a file with the name "x", please choose another name" etc. I am dealing with thousands of files here that are very tedious to rename individually. Is there an option or program that either disables this block on multiple files with the same name in a common folder, or automatically renames the files as they are placed in the folder?

    i would like all the files to have different names, but not have to do it myself. they are generated my my audio recorder, which automatically names files take1, take2, take3 etc. multiple sessions entail multiple folders, i am trying to consolidate.

  • How to check-in multiple files with same name having different revision num

    Hi
    Can anyone please tell me, how to check-in multiple files with the same name with different revision number using RIDC API.
    For eg:
    First I will check-in a file(TestFile.txt) into a content server with revision number 1 using RIDC API in ADF application. Then after some time, will modify the same file(TestFile.txt) and check-in again. I tried to check-in same file multiple times, however first time its checking-in correctly into server showing revision as 1, while checking-in same file again, its not giving any errror message, and also its not reflecting in server. Only one file(TestFile.txt) is reflecting in server.
    How to implement this functinality using RIDC API? Any suggestions would be helpful.
    Regards
    Raj
    Edited by: 887680 on Mar 6, 2013 10:48 AM

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • Migrating multiple domains with same name - how? Rename? Migrate through temporary domain?

    Hi,
    we have acquired another company, and they have multiple, separate domains with the same name (every site has a domain with NetBIOS name "COMPANY" and DNS name "company.local"). Now we want to migrate all these domains into ours using
    ADMT.
    Unfortunately, we did not manage to migrate one of these domains completely, so the trust must remain established for some time. But we have to continue with the second domain - which normally would require a trust, but of course we can't establish a trust
    to two domains with the same name at the same time.
    I found two potential solutions for the dilemma, but I'm not sure if both are reasonable:
    1) Rename the domain with RENDOM.EXE to COMPANY2 and company2.local and then migrate with ADMT
    2) Migrate COMPANY to a temporary domain such as COMPANYTEMP and then migrate from COMPANYTEMP to our domain
    Given that there are roughly 100 users, 2 domain controllers and 8 other servers, what would be the better approach? Is option 2 possible at all, so would I be able to use the sidHistory attribute migrated from the original COMPANY domain in our domain at
    all?
    There is also an Exchange 2007 server, which seems to make option 1 impossible unless we find another way to migrate it (like, export all mailboxes to PST before migration) ...

    Ok, that's what I expected. Still, I have servers in the old domain, so if I do these steps:
    first create a new temporary domain i.e COMPANYTEMP and
    create trust between COMPANYTEMP -
    COMPANY(Right)
    then do the migration with sidHistory from COMPANY(right) --> COMPANYTEMP ,
    disconnect the domain COMPANY(right) ,
    users will lose connectivity to any servers in the domain. I understand that it does not work with all domains connected? Of course I can't make OURCOMPANY's domain controllers see the DCs of COMPANY (right) in DNS (though I could achieve it the other way
    round).
    My original plan was:
    first create a new temporary domain i.e COMPANYTEMP and
    create trust between COMPANYTEMP -
    COMPANY(Right)
    then do the migration with sidHistory from COMPANY(right) --> COMPANYTEMP ,
    create trust between OURDOMAIN and COMPANYTEMP
    then do the migration with sidHistory from
    COMPANYTEMP --> OURDOMAIN,
    Migrate users
    Migrate computers
    Migrate servers
    remove trusts and old domain
    But I see that this will not work out, right? So, my only option would be:
    first create a new temporary domain i.e COMPANYTEMP and
    create trust between COMPANYTEMP -
    COMPANY(Right)
    then do the migration with sidHistory from COMPANY(right) --> COMPANYTEMP ,
    Migrate computers and servers to COMPANYTEMP
    Install new Exchange server in COMPANYTEMP
    migrate mailboxes to COMPANYTEMP
    disconnect / abandon COMPANY(right)
    create trust between OURDOMAIN and COMPANYTEMP
    then do the migration with sidHistory from COMPANYTEMP
    --> OURDOMAIN,
    Migrate users
    Migrate computers
    Migrate servers
    Migrate mailboxes
    remove trusts and old domain
    And to minimize user impact, all this would have to be done in one go (over night), which is hardly possible .........................

  • Multiple Playlists with Same Name

    What causes multiple Playlists with the same name or with the same name with a numerical suffix to appear?

    How about turning off iTunes match. Delete the PL - then reactivate iTunes Match.
    MJ

  • Chart creation using multiple series with same name

    I'm new to Numbers and to chart creation in general, so I'm not sure if Numbers is capable of what I need. But if so, I'd like to know how...
    I have a large spreadsheet with hundreds of lines of expense data, wherein each line item falls into one of a dozen categories of expense types. I would like to create a pie chart by expense type (ie, Healthcare, Automotive, Travel, etc), but Numbers wants to treat each line item as a separate expense, even though many of them share the same name. So I'm getting multiple pie slices that all say "Travel" and so forth. I really just want one pie slice for Travel, one for Auto, etc.
    So how can I make Numbers calculate the subtotals for each expense type and use those subtotals to create the chart? Is there a way to do this within the chart function or do I need to create a separate table for just the subtotals (not sure how to do that either) or what?
    Thanks!

    It appears that I missed your question.
    Here is a way to treat the problem:
    In Tableau 2 column B the formula is:
    =SUMIF(Tableau 1 :: B,A,Tableau 1 :: C)
    The column A of Tableau 2 is a header.
    Yvan KOENIG (from FRANCE lundi 14 avril 2008 14:26:37)

  • Multiple objects with same name when rebuilding index online

    I am looking for advice on how to handle a race-condition in sql server, related to reading metadata while an online index rebuild is being performed.
    The problem is as follows:
    At some point we execute the following statement:
    SELECT 
    obj.object_id AS id, 
    scm.name AS scm, 
    obj.name AS name, 
    obj.type AS type, 
    ds.name AS dataspace_name, 
    prop.value AS description, 
    part.data_compression_desc as compression_desc
    FROM sys.objects AS obj
    INNER JOIN sys.schemas AS scm ON obj.schema_id = scm.schema_id
    INNER JOIN sys.indexes AS idx ON obj.object_id = idx.object_id AND idx.type IN (0,1)
    INNER JOIN sys.data_spaces AS ds ON idx.data_space_id = ds.data_space_id
    INNER JOIN (SELECT object_id, data_compression_desc FROM sys.partitions WHERE index_id IN (0,1) /*Heap, Clustered*/) AS part ON part.object_id = obj.object_id
    LEFT OUTER JOIN sys.extended_properties AS prop ON obj.object_id = prop.major_id AND prop.minor_id = 0 AND prop.class = 1 AND prop.name = 'Description'
    WHERE obj.type = 'U' OR obj.type = 'S'";
    The statement returns some metadata for indexes (indices?), the purpose of wich is not the subject.
    When executed while an online index rebuild is running, a race condition occurs: When the rebuilding enters the final phase, the new index, which have the same name, becomes visible and thus results in two rows with the same name (from sys.object). I am unaware
    if this only occurs for clustered index (which is what we have observed).
    We became aware of this behaviour, as we added the metadata to a .Net Dictionary using name as key, and received a duplicate key exception. We have, hoewever, not been able to reproduce the situation, due to the nature of the race condition, and we found very
    little documentation on the subject.
    What we would like to do now, is to differentiate between the two. We see two options:
    1) We could just use the first of the rows and ignore the second. This solution would require that the metadata for both rows are identical.
    2) We could discern the "real" index from the "rebuilding" index. This requires some kind of extension of the Where-part.
    We have not been able to determine if the requirements for either option is present, as we havent found any documentation, nor have we been able to test for differences, as we cannot reproduce the situation.
    We would also like some way of reproducing the situation, so ideas as to how to do that is welcome.
    Can anyone direct me to relevant documentation, or alternate solutions.
    HRP

    1. Use the index with the lower fragmentation to identify the newly rebuilt index (as it almost always will have lower fragmentation)
    2. To reproduce, block the online index rebuild process by trying to alter the table's definition in a transaction (and don't commit, which will place schema lock on the table)
    Satish Kartan http://www.sqlfood.com/

  • Global Address List for multiple people with same name?

    When writing a new email, I want to add a name from the global address list of my microsoft exchange Contacts group. I select the blue plus button and type in the name. If there is more than one person in my company with the same name, both people will show up. However, Mail is not letting me see the details of either of the two people so I don't know which one is the right one.
    However, if I start from Contacts, Groups, Exchange and type in that person's name, when I select a name, a second screen will show up with the details (email address, title, etc) of the person. That way, I know which one is the correct person who I want to email. Why can't I do this directly from Mail? If I need to send an email to multiple people from the GAL, I don't want to have to search for them via Contacts.
    Thanks!

    I don't know the exact and complete specification of your intended schema...
    anyway, from what I can see in your post, I assume that
    <deed>
        <deed_type>
            <name>Quit Claim</name>
            <value>Sheriff</name>
        </deed_type>
        <deed_type>
            <name>sheriff's deed</name>
            <value>Sheriff</value>
        </deed_type>
        <deed_type>
            <name>Warranty</name>
            <value>W</name>
        </deed_type>
    </deed>would be the "proper" way to go...
    which makes your "deed_type" a complexType, including a sequence of two kinds of xs:string elements : "name" and "value"

  • Multiple apps with same name

    With all the trouble I've been having with App Store update inconsistencies, I went and looked at the directory where the .ipa files are stored. (These are the actual application files.) I was already aware of the multiple generations of files that are kept in the directory when apps are updated, but I noticed something else...
    There are some applications that have the same name. In my case, I have more than one Solitaire game simply called "Solitaire" and I have more than one Sudoku game with the name "Sudoku". It looks like the way iTunes differentiates them is by giving them generational number. For example, one Sudoku program is called "Sudoku.ipa", and another is called "Sudoku 1.ipa". Then if there is an update to the first program, it gets the new name "Sudoku 2.ipa". You can see that different programs have different files sizes, but by looking at names there is no way to tell which is which.
    I wonder if this factors into some of the problems with application updates and synching them to the iPhone? It seems odd that the same sequential numbering scheme is used for two different purposes: 1. Distinguishing different applications that have the same file name, and 2. Keeping multiple generations of the same program in the directory. It could get pretty confusing.

    If I delete extra .ipa files when two different applications have the same name, then I need to keep track of which is the current version of what. "Sudoku 4.ipa" might be the latest version of one program, and "Sudoku 7.ipa" could be the latest version of another.
    I wish Apple would create a naming scheme where every application has a unique name, and sequential generations are not used. This would make it much cleaner, and there would be no ambiguity as to either which program is which, or which version is which.
    I find the safest way to get rid of all the dups is to just delete them all and re-download the app. The bugs in iTunes still make a mess of things, though.

Maybe you are looking for