[JS CS4] Order alphabetical problem dropdownlists

Hello

I built a script simple dialogue which looks up and displays data from a CSV file. There are three drop-down lists with the first two being connected together if the selection in the second changes if the selection in the first changes.

I am very happy with that, especially since I only need update the CSV file to be filled automatically drop-down list. Someone showed me this pointed out that the second dropdown is not sorted in alphabetical order.

My problem is that I can have just one or the other list aphabetically.

Here's the code to this day, many of which I got from the kind contributors of this forum. I added a link to the script and the CSV file.


var colWidthValue = "100mm".
firstLine var = getHeadings();
firstLine.shift)
firstLine.shift)
var colWidths = firstLine;
var myPubCodeList = getCodes (0)
var myTitlesList = getCodes (1)
var l is new window ('dialogue', "Publication of information Lookup");.
w.orientation = "row";
w.addList = new Array();

1 drop
w.textPubCode = w.add ("statictext', undefined, ' Pub Code :');")
w.pubCodes = w.add ('dropdownlist', undefined, myPubCodeList);
w.pubCodes.selection = w.pubCodes.items [0];

2nd drop
w.textTitle = w.add ("statictext', undefined, 'title :');
w.Titles = w.add ('dropdownlist', undefined, myTitlesList);
w.Titles.selection = w.Titles.items [0];

w.Titles.onChange = function() {}
w.pubCodes.selection = w.Titles.selection.index;
}

3rd dropdown
w.textCols = w.add ("statictext', undefined, ' Data :');")
w.colNum = w.add ('dropdownlist', undefined, colWidths);
w.colNum.selection = w.colNum.items [0];
w.Group = w.add ("group");

w.pubCodes.onChange = function() {}
code = w.pubCodes.selection.text
cols = w.colNum.selection.index
w.Titles.selection = w.pubCodes.selection.index;
If (this.window.addList.length > 0) {}
This.Window.Group.Remove (this.window.addList.pop ());
This.Window.Layout.Layout (true);
}
this.window.addList.push (w.group.add ('statictext', undefined, getWidth (code, passes + 2)));
This.Window.Layout.Layout (true);
}
w.colNum.onChange = function() {}
code = w.pubCodes.selection.text
cols = w.colNum.selection.index

If (this.window.addList.length > 0) {}
This.Window.Group.Remove (this.window.addList.pop ());
This.Window.Layout.Layout (true);
}
this.window.addList.push (w.group.add ('statictext', undefined, getWidth (code, passes + 2)));
This.Window.Layout.Layout (true);
}
w.Show ();

function getWidth (myPubCode, myCols) {}

mySizeFile = File ("C:/size_lookup.csv");
mySizeFile.open ("r", not defined, undefined);
{}
myLine = mySizeFile.readln ();
myPubArray = myLine.split(",");
Alert (myPubArray [0] + "|" + myPubCode);
If (myPubArray [0] == myPubCode) {}
return myPubArray [myCols];
break;
}

} while(mySizeFile.eof == false);
mySizeFile.close ();

}

function getCodes (c) {}
var MonTableau =]
mySizeFile = File ("C:/size_lookup.csv");
mySizeFile.open ("r", not defined, undefined);
{}
myLine = mySizeFile.readln ();
mytempArray = myLine.split(",");
myArray.push (mytempArray [c]);

} while(mySizeFile.eof == false);
mySizeFile.close ();

return myArray

}

function getHeadings() {}
var MonTableau =]
mySizeFile = File ("C:/size_lookup.csv");
mySizeFile.open ("r", not defined, undefined);
myLine = mySizeFile.readln ();
myArray = myLine.split(",");
return myArray
}

I know that my script is probably awkward and time consuming but it works.

It would be greatly appreciated if someone could point me in the right direction to get the two lists to display in alphabetical order, but still the other day with the correct value drop-down.

Thank you

http://webbanners.nepads.co.UK/scripts/LookupScript.zip

> Err, did you really use "index2" there? If so, I think that you ignored the part of the explanation...

You're right, that should have been index1. In any case, here is an example of work. The script displays a window with list boxes (these are virtually identical to dropdowns scripting-wise, but you can see much better what's happening). Click on the list on the left, and the script selects the corresponding item in the list on the right and vice versa. The indices could probably be implemented smarter.

Peter

#target indesign;

array1 = ['A', 'B', 'C', 'D', 'E'];array2 = ['dA', 'eB', 'aC', 'cD', 'bE'];

// Create indexes -- associative arrays// index12 is used to find which item in list 1 points to which item in list2

index12 = create_index (array1, array2);

// and index21 is used to find which item in list 2 points to which item in list1

index21 = create_index (array2, array1);

//~ At this point,//~ index12 ['A']  returns 'dA'//~ index12 ['B']  returns 'eB'//~ etc.

//~ index21 ['dA'] returns 'A'//~ index21 ['eB'] returns 'B'//~ etc.

w = new Window ("dialog");    w.orientation = "row";    // display list 1 and select first item    list1 = w.add ("listbox", undefined, array1);    list1.selection = 0;    // display list 2 sorted    list2 = w.add ("listbox", undefined, array2.sort ());    // when the window is drawn, select the correct item in list 2    list2.selection = list2.find (index12[array1[0]]);

    list1.onChange = function ()        {        // selection made in list 1:         var select_in_list2 = index12 [list1.selection.text];        list2.selection = list2.find (select_in_list2);        }

    list2.onChange = function ()        {        var select_in_list1 = index21 [list2.selection.text];        list1.selection = list1.find (select_in_list1);        }

w.show ();

function create_index (a, b)    {    var array = [];    for (var i = 0; i < a.length; i++)        array [a[i]] = b[i];    return array;    }

Tags: InDesign

Similar Questions

  • InDesign CS4 PDF production problems

    I have BIG InDesign CS4 PDF production problems.  PDF files high resolution I do in InDesign CS4 cut parts of logos .ai or display the whole logo when I see, but endangered for other printers or designers send art, too.  This problem started in the last month or so.  Help, please!

    White overprint in Illustrator is usually the result of having changed the color at a given time. If the previous color has been set for a recovery, Illy is is apparently not smart enough to know that white should not.

  • Between 5.5 and CS4 color management problems

    I'm faced with a problem of color management and would be very grateful if someone could help me with that.

    I'm working to create in inDesign CS4 (6.0.6) and using my usual color management settings. I set up at the bridge in my CS4 and then use in InDesign, Photoshop and Illustrator. My settings are for jobs printed here in the United Kingdom, as follows:

    ---

    Workspaces

    RGB: Adobe RGB (1998)

    CMYK: Coated FOGRA39

    Color management policies

    RGB: Convert in the workspace

    CMYK: Convert in the workspace

    All three 'request when opening' checked

    ---

    Then I have a customer takes the file InDesign me, working there and returned to me to complete the development and execution of the high pdf - are for printing. It runs the latest InDesign CS5.5. I have him ordered to open InDesign and set his Edit > color... settings as follows without any open file is by default (am I do this bit correctly, it will work through all the files I send?):

    ---

    Workspaces

    RGB: Adobe RGB (1998)

    CMYK: Coated FOGRA39

    Color management policies

    RGB: Preserve embedded profiles

    CMYK: Preserve embedded profiles

    All three 'request when opening' checked.

    ---

    We did some testing and it doesn't work. It can open and work on the file ok and I see text changes she did without any problems.

    But when I analyze his record returned in detail, I can see that his record is now showing view > test format > Document CMYK - us Web Coated SWOP (v2)

    that suggests something coming to an end that applies US profile. I can change the configuration of evidence to work: Coated FOGRA39, but prefer the US profile never made his reappearance!

    My apologies if I'm doing a very basic error or errors here, but I usually have my color management just on my own system, so this is new territory for me. If anyone can help with what I should advise him to do to an end, I would be very grateful (she is about 300 miles north of England, so can't easily try the options on his MacBook Pro myself!)

    PS I also noticed that some items on the page have been modified when exporting .idml to 80% of transparency-enough to fool me for a while that the colors had changed over those too, when in fact I don't think that had anything to do with the issue of profile, probably just a bug between economy of process CS5.5?

    The easy way to get your colleague to use the settings that you want, is likely to create a .csf (color settings file) by pressing save button in the Edit > color... Settings dialog box, then having his press office in the same dialog box and selecting your .csf you sent.

  • AE CS4 - Render to: problems of MPEG4 of 1920 x 1080 (1.0)

    Hello

    I moved a one minute video of Premiere Pro CS4 to AE CS4 in order to spice things up a bit. First, I have given in format H.264, 25 fps, 1920 x 1080, which works very well, however trying to do the same thing in AE delicate stitching. I can't find the same settings.

    I tried to use quicktime in AE, and sometimes I managed to get a job, for my WD TV target device file (spec as below)

    Now, can someone please tell me what is happening. Surely, I must be possible to make for the same specification of the target, I AE as in first?

    Thank you!

    Video - MPEG1/2/4, WMV9, AVI (MPEG4, Xvid, AVC), H.264, MKV, MOV (MPEG4, H.264),.
    MTS, TP, TS
    Playlist - PLS, M3U, WPL
    Subtitle - SRT (UTF-8), SMI, SUB, *, SSA
    Note:
    -Supported MPEG2/4, H.264 and WMV9 up to 1920x1080p 24 fps, 1920x1080i 30 fps, 1280x720p 60 fps resolution

    When you made your first movie, you made using a SOUL presset (Adobe Media Encoder)?

    If so, you have 2 solutions:

    (1) SOUL run and select "file > import after effect model" and in the dialog box, select your AE project, then the model you want to restore. A time imported into the batch processing line, select your presset and click render.

    (2) If you want to render inside AE. Select your model, add to the queue queue rendering (ctrl-m on PC, cmd - m on Mac) in the output setting module select 'h264' as the type of video and click on "format option" and you will find the same options that you can find in the SOUL. Just put your resolution and framerate.

    Don't forget to adjust your resolution in the menu if your computer is not 1920 x 1080.

    One last thing. On the provided plug, it says 24 p and 1080i 30. As you got 25 fps, maybe you have to make it in 1080i (which means interlaced field, the top first). Try to make I nprogressive mode also, but I guess it can be a source of your problem.

    Hope that helps,

    SEB

  • Order of problems

    Hi all

    I am not able to use this statement in the SQL PROMPT. I get a message saying "State: HY000.» Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 23003] You place your order by columns not in the select list is incompatible with the following: SELECT DISTINCT, UNION, INTERSECT, EXCEPT, or from parents of the table. (HY000) ». I use DIFFERENT as there are a few months repeating itself, and I don't no wat that.

    SELECT DISTINCT (EVALUATE (as character (30), GL_PERIODS.end_date, ' TO_CHAR(%1,%2)'), "MON - YY") as A from MAIN_RPT by GL_PERIODS.end_date.

    Here's the problem, if I order by the column selected, as below, it works, but does not give me the desired result. As I changed character, it sorts alphabetically and produces a list like Avr07, Avr08, Avr09 etc, but I need like JAN07, fev07, MAR07...

    SELECT DISTINCT (EVALUATE (as character (30), GL_PERIODS.end_date, ' TO_CHAR(%1,%2)'), "MON - YY") as from order MAIN_RPT by A.

    Thank you.

    Hello

    Use below syntax

    SELECT evaluate ('to_char(%1,%2)' as a character (30), GL_PERIODS.end_date, 'MON-YY'),
    rank (evaluate GL_PERIODS.end_date ('to_char(%1,%2)' as a character (30), GL_PERIODS.end_date, 'MON-YYYY')),
    GL_PERIODS.end_date
    OF MAIN_RPT
    where to classify (evaluate Time.Date ('to_char(%1,%2)' as a character (30), GL_PERIODS.end_date, 'MON-YYYY')) = 1 order by 3

    Thank you
    Sandeep

    Published by: Teresa Sanchez on August 17, 2010 18:39

    Published by: Teresa Sanchez on August 17, 2010 18:56

  • Windows XP home - icons arranged in order alphabetical Z - A

    Hi, I have no idea why my computer started to do this, but now all my MS explore windows arange al icons in them first with the shortcuts folders Z - A, then Z - A files, although if I arrange me by type, file extensions are A - Z, but the file names are Z - A in their breast.

    If I click on "organize by type", for example, once again, it's always a - Z on everything except the file extensions are now Z - A too.

    The same thing in all my 'open' and 'save' dialog boxes. Microsoft will not give free assistance because he told me to go check with the manufacturer of my computer (I have a Toshiba Equium MX40).

    I tried messing around with a case until he is almost back to normal and to "apply the settings to all folders", but the parameters do not change on all folders and sooner or later, this issue will return to the messed up order. All apply to all folders seems to do is link pairs of files randomly so that changes to one affect the other, which is annoying when he connects things like 'my images' in 'my computer' so if I do 1 miniatures, they are two thumbnails.

    Is it possible to stop it so weird quality? I would rather not reinstall windows. My microsoft office is too weird, but I'll post that elsewhere.

    First of all, it certainly isn't a problem of laptop but deliver only Microsoft Windows.

    I found a very nice sites on the configuration of the Solution Explorer.
    She explains how to customize the display, adding categories to the details view, using the folder models, etc.
    http://vlaurie.com/Computers2/articles/Explorer3.htm

  • Sport clip do not order alphabetical new music added

    I have used the Sport Clip for a few months now and when you add new music by drag and drop on my albums new PC are in alphabetical order as expected. Now, all of a sudden new albums are added and remain at the bottom of the list instead of in alphabetical order... why would this happen? Clip is connected to the PC and I will review the entry music they are displayed properly classified in alphabetical order, but not on the Clip itself when removed from the PC.

    Wow, this is so great! thx a lot for the solution... you da man.

  • No e-mail the order after problem with processing status.

    I ordered and received a confirmation email that says there is a problem with the processing system. He said as I would receive an email with the status of my order within 24 hours, and no such email arrived after more than a day. I Don t know how to proceed and access the product.

    Hello Daniela,

    I am able to see an active subscription on your e-mail address, please check if the problem is resolved?

    Kind regards

    Akshay

  • New computer, transfer CS4 Design Premium problem

    I had CS4 Design Premium (education) on my 2006 MacBook Pro. The computer crashed, I bought a MacBook Pro 2013 and I am trying to transfer the license or product on the new computer. I don't have the original disks, but I had saved the software in Time Machine. CS4 downloaded on the new computer, but it gave me a license error when I tried to open it. I uninstalled on the Mac to 2013, got my serial number of MyAdobe and I am try to download again, but it tells me that my serial number is not valid.

    I found through the forums/troubleshooting there are a few reasons why it doesn't work:
    -New material/new Mac software is not compatible with CS4

    -All products in the suite has its own serial number and must be entered individually * (I don't know where to find these individual numbers)

    -Teaching discs purchased through 3 parts (College Library) might have codes different series/product numbers

    Anyone have an idea how I can do this freakin thing ' work? I need to get my CS4 working again for school/work and cannot afford to buy another version.

    Thank you!

    CS4 is compatible with lion, lion mt and the mavericks, but NOT to transfer the files.  use the installation files to install your programs.

    If you follow the 7 steps you can dl a free trial here: http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html

    and activate it with your serial number.

    If you have a problem dl'g, you don't follow all 7 steps.  the most common mistake is not meticulously follow the steps 1, 2, and/or 3 (which adds a cookie to your system, allowing you to download the correct version of the adobe.com site).

  • Uninstall cs4 without causing problems with cs5

    I have both CS4 and CS5 installed on my laptop.  I want to free up space on my hard drive uninstalling CS4.  I want to assure you that I don't have any problem with my CS5 installed, that works perfectly.  Any suggestions?  The precautions I take?

    Thank you

    Lisa

    There is no way to prevent the problems I know.  Deleting an older version after a new installation problems.  You will have to perhaps to reinstall 5, or worst case, clean the system disk and reinstall all Windows on the spot.

    Does not not not saying things will go bad, just that they pourraient .  Be prepared.

  • Order customization problem in sales order form Standard type

    Hi all

    We have a problem in the sales order form customization. Here we try to customize three field based on the type of order


    Scenario 1:_

    _NAV-> Oredr management Super user-commands, returns-> sales > orders-> order->standard _ type

    In this type if we are sailing to the lines, he should ask the following fields as required
    (Nav-> Oredr management form Super User-> commands, returns-> sales orders-> others)

    1. mode of delivery
    2. conditions related to the transport
    3. priority shipping of

    Scenario 2:_

    _NAV-> Oredr management Super user-commands, returns-> sales > orders-> order->Bill only & _ internal & RMA type

    then he must navigate to line items without asking these three fields.

    To do this, we made the following customization by help-> Diagnostics-> Custom Code-> customize

    Level-> shape
    Activated-> Yes

    _ Condition

    Triggering event: When-validate-registration
    Trigger object: order
    Condition: +(:ORDER.) ORDER_TYPE not like '% INTERNAL') and (: ORDER.) ORDER_TYPE do not like ' % BILL %') and (: ORDER.) ORDER_TYPE not like '% RMA') +
    Processing mode: both
    level: site

    _ Of the actions

    SEQ:10
    type: property
    Description: Make required field
    language: all
    activated: Yes

    object: article type
    target object: ORDER. SHIPPING_METHOD
    property name: REQUIRED
    value: TRUE

    Problem+ _

    The problem we face is when we first select the type of ordar like Bill only or internal or RMA it works as expected. But first we have to select the standard type order then we navigiting in the lines if not allowing us without going into these three fields as expected. This is why the problem is without closing the form, we changed the type of order like Bill only now also these fields as mandatory, that is the question.

    So hope the problem is clear to you all and we must pass this into production tomorrow.

    If somone can help to solve this as soon as POSSIBLE, we would be grateful to you.

    Thanks in advance

    Kind regards
    CSK

    Double wire.
    Please see my answer to the problem with customization of Oracle customer order forms
    and update this thread.

    Sandeep Gandhi

  • Bridge CS5 with CS4 files cache problem

    If I use Bridge CS4 on a directory, then open the directory even with Bridge CS5, bridge insist on rebuilding thumbnails and previews (as shown on the lower status line).    If I reopen it then the directory in Bridge CS4, it rebuilt again inches and previews - but only inches seem to be rebuilt.   Preferences in both versions of the bridge are "identical".  The bridge cache files are kept in directories of images.

    The construction of the cache seems to be pretty fast (faster than expected) - I don't know what, if anything, is being rebuilt.

    What is an operation expected?

    This poses some difficulties that I have 530 000 images (7 terabytes) on Bridge CS4 and the reconstruction of the files would literally take weeks to rebuild.

    Central cache built in Bridge CS4 allows not in Bridge CS5, as expected.  But there is a way to save a lot of time is the construction of a local cache in CS4, which will produce 2 hidden files '. '. BridgeCache «and» BridgeCacheT' in the same folder with your images.  After that when you open the folder in CS5, the thumbnails can get out of the local cache, which will be much faster to rebuild the cache.

    For reference, there are 2 ways to build the local cache:

    1. check the option "Automatically export Cache files when Possible" in preferences > Cache.  This will produce a cache local to each folder as you navigate so you don't need to worry about build manually.  It is unchecked by default.

    2. manually build a local cache for a folder and all its subfolders by innovation in the folder that you want to build, then the selece tools > Cache > build and Cache export, with the option "Export Cache files" checked, click 'OK '.

    Please try it and tell me if this solves your problem.

    Thank you!

  • CS2 &gt; CS4 text color problems

    I recently imported some files CS2 in CS4 and also a few quarters of text, all seems good, but when that we send it to print, some of the text prints black. I went through the file by ensuring that there was no transparency, without spot color settings/effects, etc., but it (and it's related files to always print with the same problem.

    It exports to PDF very well and allows to print from there, but no InDesign itself. I even exported to .inx and back, with no changes.

    Any ideas?

    (attached is one of the pages in question.) It affects only the text on blue. Both were swatchs converted to CMYK, Pantone so I recreated the CMYK shade from scratch, but there was no change to the impression that results. "And change it to any other non-white color prints in black).

    The next question is obvious: is any impression of colored text? If this is not the case, check for a setting in the print dialog box and the print driver, for "Black text".

  • Order of problem in the update rollup

    Hello

    I'm sorting problem, when I use rollup function to calculate the subtotal.

    Select region, country, port_id, sum (quantity) in Port_Dtl
    Rollup Group (region, country, port_id)

    In the above query, I want to sort the results by increasing Port_id.

    Any idea?

    Hi kumar,.

    Just use the query for your results below

    select   region, country, port, sum (quantity)
        from otn_temptable
    group by cube (region, country, port)
      having grouping (region) = 0 and grouping (country) = 0
          or grouping (region) = 1 and grouping (country) = 1
             and grouping (port) = 1
    order by nvl(port,lag(port) over (order by country)), port;
    

    Just vote for it, if you like.

    Kind regards
    Kiran.

  • Windows 2010 Live Mail loses attachments and sent box, Windows Live 2010 cannot sort by COLUMN by order alphabetical-how to to back to the old Windows Live Mail

    After Windows 7, computer portable 64-bit Windows Live Mail update to version 2010 in fall 2010, some attachments fail to my computer.  I can see them at the opening of mail on the work of the Windows XP computer, use comcast web mail, so I don't know the attachments exist.  When I get home and open it with Windows Live Mail, the message through (comcast), and the attachment is missing.  Can I go back to an older version of Windows Live Mail because I have attachments on the same computer.  Second problem: in letters, I can't sort messages sent by COLUMN.  They always sort by DATE, even if I want to sort by TO.  This isn't a problem in the IN box.

    Hello Carol_1234,

    There is a forum for Windows Live products. They have experts who specialize in Windows Live and will be better able to answer your questions.

    Click here for a link to the Windows Live Help Forum. Then click on mail.
    http://windowslivehelp.com/

    Thank you

    Marilyn

Maybe you are looking for