How to sum all items in a list in applescript?

Hey guys,
I wanted to sum all items of a list full of numbers and divide the number by the count all items of a list, is there a easy way to do this?
Thank you so much in advance

You didn't say which is the source of the list.
Assuming that the list isn't extractyed from a Numbers table Niel's answer is OK.
If you installed the free OSAX Satimage
http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html
you may study its arrays functions.
For this tool, a list is a simple array so you may apply the function statsrecord
Yvan KOENIG (VALLAURIS, France) samedi 4 février 2012
iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

Similar Messages

  • How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    How to show all items in the reading list? I think this option has been removed in Safari Version 7.0.2

    Thanks. That solved it. I had my doubts since I wasn't concerned about my lost bookmarks. I was concerned about the broken functionality. In any event, restoring from a backup solved both the functionality and the lost bookmarks. I appreciate the response!

  • How to delete all items in the HUB ?

    How to delete all items on shot in the HUB ?

    Hi all,pay attention to the words I've marked in bold in the first answer from the technical support member:  "From the BlackBerry Hub, hold your finger on the date at the top of the list. A side menu will appear. Click on the Garbage Can to delete all messages prior to that date" At first, I also didn't understand how to make it works, but you have to slide until the date is at the top of displayed messages, then you can tap and hold to select all messages preceding that date. 

  • Retrieve all items in a list by caml query then write it to a word file page by page

    Dears,
    Greetings
    I have some code which will retrieve all items of a list with caml query.
    Now i want to generate a word file with all these retrieved data. I am using foreach here to get all the items in a SPListItemCollection. Now my question is how i can write all the retrieved items inside the word file?
    see the below code which is writing only the last row item of the SPListItemCollection inside word file. I want to write all the retrieved rows inside this word file.
    SPQuery qry = new SPQuery();
    qry.Query = "<Where><Eq><FieldRef Name='Department' /><Value Type='Text'>HR DEPARTMENT</Value></Eq></Where>";
    SPListItemCollection listItems = KPILIst.GetItems(qry);
    foreach (SPListItem item in listItems)
    lblBadgeNo.Text = item["Badge No"].ToString();
    lblName.Text = item["Name"].ToString();
    lblPosition.Text = item["Position"].ToString();
    lblDept.Text = item["Department"].ToString();
    lblHireDate.Text = item["Hire Date"].ToString();
    lblGrade.Text = item["Grade"].ToString();
    lblCurStatus.Text = item["Status"].ToString();
    string FinalOut = "";
    FinalOut = "<table cellpadding=0 cellspacing=0><tr><td style='height:30px;'></td></tr><tr><td style='height:22px;'></td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblBadgeNo.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblName.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblDept.Text + "</td></tr>";
    FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblHireDate.Text + "</td></tr>";
    FinalOut = FinalOut + "</table>";
    System.Text.StringBuilder strBody = new System.Text.StringBuilder("");
    strBody.Append("<html " + "xmlns:o='urn:schemas-microsoft-com:office:office' " + "xmlns:w='urn:schemas-microsoft-com:office:word'" + "xmlns='http://www.w3.org/TR/REC-html40'>" + "<head><title>EPCCO : HR Comapny Letter</title>");
    strBody.Append("<!--[if gte mso 9]>" + "<xml>" + "<w:WordDocument>" + "<w:View>Print</w:View>" + "<w:Zoom>90</w:Zoom>" + "<w:DoNotOptimizeForBrowser/>" + "</w:WordDocument>" + "</xml>" + "<![endif]-->");
    strBody.Append("<style>" + "<!-- /* Style Definitions */" + "@page Section1" + " {size:8.5in 11.0in; " + " margin:1.0in 1.25in 1.0in 1.25in ; " + " mso-header-margin:.5in; " + " mso-footer-margin:.5in; mso-paper-source:0;}" + " div.Section1" + " {page:Section1;}" + "-->" + "</style></head>");
    strBody.Append("<body dir=rtl lang=EN-US style='tab-interval:.15in'>" + "<div class=Section1>" + FinalOut.ToString() + "</div></body></html>");
    Response.AppendHeader("Content-Type", "application/msword");
    Response.AppendHeader("Content-disposition", "attachment; filename=Eval_" + lblBadgeNo.Text + ".doc");
    Response.Write(strBody);
    Regards
    Shaji
    I am new to SharePoint

    Hello,
    you can try with OpenXML SDK to create word file. I found one link for your reference:
    http://sharepointplace.blogspot.in/2009/12/programmatically-creating-word.html
    Another way is , use Microsoft Word Object Library.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/5b82c0b5-ecaf-40f2-a68a-c7c17c85414f/create-word-documents-by-c?forum=csharpgeneral
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to enumerate all items in a primary table

    I have a primary table with a data structure as its data element. I also have a secondary table with an index pointing into the primary table.
    Is there an example of how to enumerate all items and reset one of the fields in each element in the primary table to 0?
    thanks,
    chris

    Hello,
    Have you taken a look at the examples directory that come with
    your distribution? You did not mention what platform/version/API
    you are using, but under your Berkeley DB home directory you should find
    examples_c/examples_cxx/examples_java. Under those directories
    is a getting_started directory. I believe that the examples there
    illustrate what you are asking about.
    If you have not done so already, you can also check the sample code
    in the Chapter on "Secondary Databases" in the "Getting Started Guide" at:
    http://www.oracle.com/technology/documentation/berkeley-db/db/gsg/C/indexes.html
    Thanks,
    Sandra

  • Programmatically select all items in a list

    Hi, I've been looking through the online docs trying to find
    a way to programmatically select all items in a list. I have a
    checkbox that when checked should select all items in a list. I
    found a method to clear all selections but not one to select all.
    Did I just miss it? Thanks!

    I don't know of any built-in functions to select all list
    items, but here is an example function to select all items in a
    list:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns="*" layout="absolute">
    <mx:Script>
    <![CDATA[
    [Bindable] private var people_xml:XML =
    <people>
    <person>Jen</person>
    <person>Brian</person>
    <person>Scot</person>
    </people>;
    private function select_all():void {
    var indices:Array = new Array();
    for (var i:uint = 0; i<people_xml.children().length();
    i++) {
    indices.push(i);
    peopleList.selectedIndices = indices;
    ]]>
    </mx:Script>
    <mx:Button x="125" y="10" label="Select All"
    click="select_all()"/>
    <mx:List x="10" y="10" allowMultipleSelection="true"
    dataProvider="{people_xml.person}" id="peopleList"
    labelField="person" width="107"></mx:List>
    </mx:Application>
    Vygo

  • How to display all items titles from custom list with checkbox to select for each user

    Hi All,
    I have a requirement in a sharepoint 2013 development project.
    A custom list items will be created by admin with the following columns:
    Title
    Hyperlink
    User business unit (This column which is a metadata will be a userprofile property)
    In a page/form I have to display the list of titles with a check box based on each user business unit and each user will be allowed to check the list of titles and hit save. And then have to display the list chosen by the user in a webpart.
    If they want to modify their list they have to go to the page/form again and will uncheck the list.
    Am not sure whether I can achieve this through sharepoint out of box feature, I have not done any custom development.
    Please provide your valuable suggestions/ideas on this. Thanks for looking on this !!!

    Hi,                                                             
    Per my knowledge, there are no such OOTB features can meet your requirement, however, there is a workaround that if you can modify your requirement a bit.
    Based on your description, you want different users be able to select values from a list and generate a list own by them.
    If this is what you mean, we can do it like this:
    1. Create another list "Users" which stores the names of every users;
    2. Create a list "Result" which will be available for every user to add their own items, this list will have four Lookup columns and they look up to the "Users" list and the
    list you mentioned before;
    3. Users can add items into "Result" list by selecting the needed values from the other two list, then the items he/she created will be connected to them with the help of the
    Lookup column which looks up to the "Users" list.
    4. You can take use of the OOTB permission management of list to control the access of each item in the "Result" list, and it will be easier for you to manage and filter the
    information you needed.
    The links below about Lookup column for your reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx
    http://www.dummies.com/how-to/content/lookup-columns-in-sharepoint-2010.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to report all items in a folder, including subfolders?

    I've got a folder structure like this:
    Examples
    Product1
    Ver1_0
    Ver1_2
    Product2
    ver5_5
    Ver6_0
    How do I generate a Report that lists all items in a certain
    subfolder, including all subfolders?
    For instance how to list all items in the Examples folder and
    below (e.g all items), or how to list all items for the
    folder /Examples/Product1 and below?
    I need to provide a read-only view of the items in a report etc
    for one user-group. There might be a better way than a
    report...!?

    The spaces in the folder structure got stripped off...
    Trying to show it by prepending >'s instead of spaces to show
    the hierarchy:
    Examples
    Product1
    Ver1_0
    Ver1_2Product2
    Ver5_5
    Ver6_0
    (I hope u get it)

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • IDCS2 Win: How to iterate all items in a group item?

    I want to access each item in a page group item, How to do that? Any guide or code snippet will help. Thanks in advance.
    Haikun

    you can use InterfacePtr<IHierarchy> hier(group, UseDefaultIID()); <br /><br />and then hier->GetChildCount() & hier->GetChildUID(n) or hier->QueryChild(n) to visit all its direct children.  Hier->GetDescendents gets a list of all items in the group (including items in a group that are in the group).<br /><br />Ian

  • DAQ board + view sensor temp and pressure + labview, how to run all item with LV ?

    hi all,
    it seems my duty almost clear....i just make manual programe with labview. So I have a case at my campus. We have a spakr-ignition machine, we use it for know how much we consume fuel,torque. I have a some PCI card (DAQ) some interface to connect it to PC. And I'm confiused to organize all item. Could you guys give some explanation for connected them with labview ? I will post a DAQ pic and interface pic.
    thx
    maput

    Hello maput,
    Thank you for contacting National Instruments. Ssk's suggestion of a starting point is a good place to begin.  Many of our DAQ cards can handle -10 to 10V analog signals, however you may also have digital signals as well.  Some places to look for how connect everything together are listed below:
    DAQ Getting Started Guide
    Field Wiring and Noise Considerations for Analog Signals
    Here are some other good links to help you get started with programming:
    Getting Started with DAQmx
    National Instruments Training
    Getting Started with NI-DAQmx: Getting Started with NI-DAQmx Programming in LabVIEW
    Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
    If you provide the model numbers for your DAQ card as well as any connector blocks or cables you have,  it would help even more than pictures.  I hope these links give you some place to start.  Please post back with any other questions you have.
    Neal M.
    NIC AE
    www.ni.com/support
    Neal M.Applications Engineering       National Instruments        www.ni.com/support

  • Infopath Drop Down List not showing all items in a list

    I have an Infopath form where I have a vendor drop down and then I filter the product list based on the vendor. The problem is the drop down list is only filtering through the first 100 records. I added a second drop down with the model#'s and no filter and there is only 100 values showing. I checked the All Items view and it is set to display all records. Does anyone know how to fix this?

    Hi all,
    If I want a drop down list in InfoPath (data coming from a SharePoint list) to be in a particular order I query the SharePoint list via this method
    http://blogs.msdn.com/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx
    You can create a data connection to a particular view in SharePoint - make sure that view is sorted how you want it to be and the item limit is set to 9999.
    You do not need code for this method and it works in browser enabled forms.
    The people picker (which also works in browser enabled forms) http://metahat.blogspot.com/2007/05/people-picker-control-for-infopath-2007.html can help with those of you trying to get a list of users.
    Cheers.

  • How to delete all items in download folder under bookmark in the shortest time?

    I understand that all downloads from internet and yahoo/google mail are stored in the "Download" folder which I see under bookmark when I want to delete. I think that if the download folder is never emptied, then my mac will slow down. Therefore I want to delete these downloads which I have already seen. How do I delete ALL items in the shortest time? Deleting items, even in groups, takes a long time. Is there a method that I can use so that all items in the folder are deleted in one stroke?
    Thanks.
    Unguja

    Try (first button on toolbar) Organize > Select All (Command + A) to select all items in the right pane in the Library.

  • How to remove all item in JPanel???

    How to effectively remove all item before add new item and display new panel??? I only know
    p1.setLayout(null);But seems like my JButton still there....Please advice

    As we dunno what the item in the panel, we just want to clear all item in panel. Because the clear panel in action listener, it perform clear the previous panel before display new panel.
    Please advice

  • How do i remove items from purchased list in iTunes store?

    The Purchased items in iTunes show everything i ever downloaded to my iPod.
    How can i remove some of the items?
    The list is way too long.
    So items were downloaded to see what they do.

    yeah... same question from my side.....

Maybe you are looking for

  • My external hard drive (G-DRIVE Slim 500GB) won't mount?

    My external hard drive (G-DRIVE Slim 500GB) won't mount? All of a sudden my hard drive didn't show up in my finder. I checked in disk utility and it was there but greyed out. If I tried mounting it told me that could not be mounted and that I should

  • Filter in group above report

    Hello Friends, I have made a report in Reports3.0 version. The report uses 2 groups which I will refer as "Top" and "Bottom".I filter the data from "bottom" group using the group filter function. It so happens that when the all "Bottom" group is filt

  • Want to Archive(or)Delete the file after finish the processing tht message

    Hi,    My scenario is File to File  scenario that is working fine. due to some performance reasons i want to Archive the file (in sender communication channel level) after finish the process . that means after genarting the file in the target directo

  • How to Assign Profit Center to a Sales district

    Hi, How to Assign a Profit Center to a Sales District thru standard configuration.

  • Looking for the oracle equivalent of T-SQL 'SELECT TOP n'

    Hi, I'm looking for the Oracle equivalent of T-SQL 'SELECT TOP n' and can't find any. There is SAMPLE(n) function but it supposed to pick up random values and I'm not sure if it's possible to make it select top values. Please help 8-) Thanx