Lists, groups and selected item

I'm trying to learn how to work with lists and I'm just not getting it. I've been working on this for days now to no avail.
My first problem is eachItem is returning only last entry of groupsList instead of the selected specifiedGroup. Then what I would like to do which I'm not too keen on either is, take that selection and match it to one of the choice groups which would contain files or something that the user has preselected previously. Thanks so much! I'm learning a lot of Applescript lately but these lists get the best of me still as I don't fully understand how they work yet. Hoping this will clear my head on things.
property groupsList : {"List1", "List2", "List3", "List4", "List5"}
property specifiedGroup : {}
property choiceOne : {}
property choiceTwo : {}
property choiceThree : {}
property choiceFour : {}
property choiceFive : {}
choose from list groupsList
copy result to specifiedGroup
log specifiedGroup
set results to (every item of groupsList)
repeat with eachItem in results
          if eachItem = specifiedGroup then
                    exit repeat
          end if
end repeat
log eachItem

AppleScript doesn't support variable variables, so you can't refer to variable names like that (at least not in regular AppleScript).  Using a record isn't that much better, because you can't use variables to refer to property keys, either. There are a couple of cheats that use run script, but usually those are more of a pain that they are worth.
One way that is similar to what you are thinking about would be to create a list of lists, then use your choice to index into that list, for example:
property groupsList : {"List1", "List2", "List3", "List4", "List5"}
property choiceOne : {"choiceOne", "this is list 1"}
property choiceTwo : {"choiceTwo", "this is list 2"}
property choiceThree : {"choiceThree", "this is list 3"}
property choiceFour : {"choiceFour", "this is list 4"}
property choiceFive : {"choiceFive", "this is list 5"}
set listOfLists to {choiceOne, choiceTwo, choiceThree, choiceFour, choiceFive}
set theChoice to (choose from list groupsList) as text
if theChoice is "false" then error number -128 -- cancel
set specifiedGroup to missing value
repeat with i from 1 to (count groupsList)
  if item i of groupsList = theChoice then
    set specifiedGroup to item i of listOfLists
    exit repeat
  end if
end repeat
log specifiedGroup

Similar Messages

  • List and selecting items in it ?

    I use List (element in building GUI). In emulators it works nicely and I have possibility to select one item from the list (I didn't code anything about selecting it) it was automatically added to menu. This is great.
    When running the same app in actual device (Nokia 7210), the "select" is not possible / provided by the phone...Theere is no such element at all. So I actually can't select an item out of list.
    In nokia 7650 this doesn�t occur.
    My mistake, need to program ? .. how to proceed ?
    P

    Funny that mine doesn't work and I have the same firmware version...
    My situation is that I have a List, with items that are ment to be selected.. I need to have commands generally concerning the whole application and commands that are available after user have selected one item from the list.
    This is now done so that I have one List (holding those selectable items...), select button then leads to another list, where I have list of actions available to selected item.
    The previous list also has Commands appended to it.
    These commands are always available, but in phone the List Select button is gone, and accesing that other list (with detailed actions concerning only the selected item) is then impossible.

  • WorkflowHistory List ID and Primary Item ID is null - VS /SharePoint App Workflow

    This is very puzzling. I have WriteToHistory activity (OOTB) in my SharePoint State Workflow. When source list gets updated, workflow fires and  first activity is called is  WriteToHistory
    activity.
    In the workflowhistorylist list , I don't see List ID, Primary Item ID  populated (I do see workflow history parent instance, association ID, user id,
    date occurred,Description are populated).  BTW, workflow template ID, event type, group type, outcome , duration and data are also empty - I don't want it for my solution so I don't care for now).
    Has anyone seen this ? Any help or pointers?
    Thank you so much.
    DT

    Hi,
    If you use SharePoint designer workflow create a SharePoint 2013 workflow, the List ID and Primay Item ID in workflow history list also is null. I'm not find a official document to explain this things.
    If you want to dubug in visual studio workflow, we can use the following debugging techniques:
    1. Setting breakpoints
    2. Sending debug messages to the console
    3. Monitoring traffic between SharePoint and Workflow Manager with Fiddler
    We can customize a workflow action to achieve your requirement.
    How to: Build and deploy workflow custom actions
    http://msdn.microsoft.com/en-us/library/office/jj163911(v=office.15).aspx
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Tool to list blocks and block items

    i'm wondering if there is a tool that can exhaustively list block and block item names for auditing purposes?
    thanks again.

    Hai,
    Try this Code
         Str_First_Block   VARCHAR2(100);
         Str_Current_Block VARCHAR2(100);
         Str_First_Item          VARCHAR2(100);
         Str_Current_Item     VARCHAR2(100);
         Str_List                         VARCHAR2(32767); -- *the max of varchar is 32767*
    BEGIN
         Str_List := NULL;
         Str_First_Block := NAME_IN('SYSTEM.CURRENT_BLOCK');
         Str_Current_Block := Str_First_Block;
         LOOP
              Str_First_Item := GET_BLOCK_PROPERTY(Str_Current_Block, FIRST_ITEM);
              Str_List := Str_List || CHR(10) || Str_Current_Block || '.' || Str_First_Item;
              Str_Current_Item := Str_First_Item;
              LOOP
                   Str_Current_Item := GET_ITEM_PROPERTY(Str_Current_Item, NEXTITEM);
                   EXIT WHEN Str_Current_Item IS NULL;
                   Str_List := Str_List || CHR(10) || Str_Current_Block || '.' || Str_Current_Item;
              END LOOP;
              Str_Current_Block := GET_BLOCK_PROPERTY(Str_Current_Block,NEXTBLOCK);
              EXIT WHEN Str_Current_Block IS NULL;
         END LOOP;     
    END;this will give you the full items list of the current form. keep and eye on that Str_List variable, as the size of that variable is too small.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • List and selected item

    Hello,
    I’m having difficulty to understand list items,
    Here is what I need to do, I list item loaded from a table, all looks good
    Now when someone select the item from the list, I would like to put a code
    Behind button (mouse-click) and show selected item in text box (TEXT ITEM)
    Please don’t ask me to help file, I spent over two hours with no chance, looks help file
    Needs help.
    Thanks for any help in advance

    your question isn't clear at all.
    first: When you change the value of a listitem you can use the WHEN-LIST-CHANGED-trigger to do something.
    if you want to transfer the value of a list-item into another item, then you can write this code in the trigger WHEN-LIST-CHANGED
    BEGIN
      :my_block.my_item := my_block.my_listitem;
    END;or do you need something different?

  • CheckBox Group Get Selected Items

    Hi, I have a problem with a CheckBox Group.
    I have different items in the CheckBox Group, and I get the items that are selected.
    When I do the checkboxgroup.getselected () returns the selected items, but I do not know how to get the values separately.
    I tried to do:
    ArrayList array = new ArrayList ();
    array. add (checkboxgroup.getSelected ());
    but in the array.get (0) add all the values. And I need:
    array.get (0) -> first value selected checkboxgroup
    array.get (1) -> second value selected checkboxgroup
    array.get (2) -> third value selected checkboxgroup
    Thank's !
    Edited by: henrynxd_08 on Jul 16, 2009 4:55 AM

    Never mind..I got it.
    it as simple as that:
    Alert.show (lst.selectedItem.fieldname);
    ;)

  • IA07 : Key for Task List Group and Production resource tool number link

    HI abapers,
    In IA07 TCODE , i want to retrieve Key for Task List Group( PLNNR ) and Production resource tool  number ( FHMNR) .
    In technical settings for both the feilds, structure names are mentioned.
    Is there any function module or table link to retrieve both .
    thansk & regards
    Raghul

    Hi Raghul,
                    i am also facing the same issue. Kindly let me know if u get any solution for this.
    Thanks in advance.
    -AruN.

  • Tasl list group and group counter

    hi,
    i have one requirement . I have give internal number range to the task list. so my need to to create task list with one group and several group counter. But what is happening is when i run LSMW for that. seperate group numbers has been generated for each task list. is there any way to get the same group number with different counters using LSMW>

    hi
    since you have given internal number range for task list system will try to create task list with different group numbers .if you want the same group number with different group counter then i think you have to use the task list with external number and use the number created before
    regards
    thyagarajan

  • Headers in Dropdown lists? (Non-selectable items)

    Does any one know how to make headers in dropdown lists? I have 2 groups of items I want to add a header for each in the dropdown list. The headers just have to be non selectable.
    thanks,

    Hi Kris,
    In Designer 7.1, I created a DropDown List which includes Headers and sub categories under these headers, where the Headers are not selectable. When I built my DropDownList I then assigned Values to each item in the list, which I've put in brackets for you:
    HEADER ONE (10)
    Item A (1)
    Item B (2)
    Item C (3)
    HEADER TWO (11)
    Item X (4)
    Item Y (5)
    Item Z (6)
    This is the JavaScript I wrote on the Exit event:
    if (DropDownList.rawValue > 10) {
    DropDownList.rawValue = "";
    Hopes this works for you.

  • How to list groups and members of the groups

    Is there a way to list out groups by the group name and list out the members in those groups? I have been tasked with providing the group names and the members in the group on an Exchange 2010 server.

    Here is my text capture exactly from my powershell after I copy and paste. You can see it starts to output the results in the console but also sends to the txt file. My guess is when you're copying and pasting there is a break somewhere.
    [PS] C:\temp>write-output "" > C:\outputDGmembers.txt
    [PS] C:\temp>get-distributiongroup | Sort -Property DisplayName | foreach {
    >> $name = $_.displayname
    >> $output = `Group Name: ` + $Name
    >> write-output $output >> C:\outputDGmembers.txt
    >> Get-DistributionGroupMember $name | Sort -Property DisplayName | Select Displ
    ayName, Alias, Department >> C:\outputDGmembers.txt
    >> write-output "" "" >> C:\outputDGmembers.txt
    >> }
    >>
    WARNING: Object ipcfcdom.inphonic.com/Distribution Groups/ATTClientServices has
     been corrupted and it is in an inconsistent state. The following validation
    errors have occurred:
    WARNING: There is no primary SMTP address.
    WARNING: Object ipcfcdom.inphonic.com/Distribution
    Groups/[email protected]
    has been corrupted and it is in an inconsistent state. The following validation
     errors have occurred:
    WARNING: "[email protected]" is not valid for Alias. Valid values are:
    Strings formed with characters from a to z (uppercase or lowercase), digits
    from 0 to 9, !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or
    more periods may be embedded in an alias, but each one of them should be
    James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com

  • How to internationalize h:selectOneMenu and select items.

    I'm trying to have a web app in different languages which is working fine.
    my question is, here I post an example of selectOnemenu
                   <h:selectOneMenu value="#{user.gender}">
                   <f:selectItem itemValue="1" itemLabel="#{dropdown.male}"/>
                   <f:selectItem itemValue="2" itemLabel="#{dropdown.female}"/>
                   </h:selectOneMenu>
    where it said "dropdown.male" this valude is coming from properties file from the application rather than database or list. I did this because the user can change the language by selecting the appropriate properties file
    ex: dropdown_de.properties for Germen Language or dropdown_it.properties for italian.
    if the user select female from the dropdown, when I go in editing mode, I want the the first one or the selected one to be first. how I can do that? if it was array or list i could have done it but from the properties file its kind of difficult.
    I could not find this solution from books or online. I hope some one has the answer for me.
    code example is greatly welcome.
    Thank you in advance.

    harddisk wrote:
    if the user select female from the dropdown, when I go in editing mode, I want the the first one or the selected one to be first. how I can do that? if it was array or list i could have done it but from the properties file its kind of difficult.
    I could not find this solution from books or online. I hope some one has the answer for me.I don't clearly understand the problem, but I assume that you want to preselect an item? If so, then you should be presetting the value behind #{user.gender} to 2.

  • HT204074 I need to de-authorized older macbook and iPods. I went through manage my account, read support, but there is not a choice to list devices and select to de-authorized device, only de-authorize all! I have several old devices and need to add new p

    I need to de-authorize older macbook and ipods. I read support for Itunes via my account. Directions to "manage devices", but only choice is to deauthorize all computers.  How can I get list of all devices?  My account says four devices are alread authorized under my ID, but does not list them. Please advise. thanks.

    The title of my initial post is a bit misleading. I already took a chance deleting one of the iPhones, hoping if I deleted the wrong one, I can still reauthorize it (all with the same Apple ID acct, so not subject to 90-day waiting period, right?) The iTunes database just updated itself, and it says I have 4 "devices" "in the Cloud", but 5 "computers" associated w my account. How can I find out what computers are associated? Isn't there a list I can see? I dont have a clue what computers they might be. If I use the  "Deauthorize All" option, is it a pain to add them all back in. I assume I would have to log in from each computer to reauthorize each one. Would I have to be running the newest OS or version of iTunes to reauthorize? I think I have a PowerBook G4 Titanium with an older OS and iTunes. I'd like to keep that authorized, if possible.

  • Flashing screen and selected items flicker

    the Screen flashes often and every selectable link flashes.

    Not tried another cable as the it is only the wallpaper that is flashing so not sure how a dodgy cable would cause this effect. The top menu bar doesn't flash (although the image behind does) and currently, mail is open but is not flashing, it just seems to be the background wallpaper.
    Again, there is no dock at the bottom.
    I am in the UK so unfortunately, Apple support are out-of-hours at the moment (21:50 uk time).
    Cheers.

  • Getting a lists selected item itemRenderer's properties

    Is there a way to get a Spark List's selectedItem itemRenderer's contentToGlobal x and y and it's height values?
    Thanks,
    John

    Hello Shongrunden;
    Thanks again for your help, if you don't mind me asking a couple of more questions...
    - With a scrollable Spark List, if a selected item is partially in view, is there a method to get just the visible height of the itemRenderer?
    - Also, on my custom paged List component, with a custom itemRenderer and useVirtualLayout = true, after the list data is retrieved a resultHandler is called, in this I then call your getRendererCoordinates function.  I also call  getRendererCoordinates() in a listChangeHandler.
    After the resultHandler calls getRendererCoordinates, even though the dataGroup is showing the proper number of elements, and I set the list.selectedIndex to 0, the renderer variable created in;
    var renderer:IVisualElement = list.dataGroup.getElementAt(list.selectedIndex);
    the renderer var returns null on the initial display called from the resultHandler, but ... it works perfect on on the listChangeHandler and subsequent page displays.  So it seems the renderer is not finished being drawn when getRendererCoordinates is being called from the resultHandler, but subsequent page displays work probably because the renderer has already been drawn.  I've tried callLater(getRendererCoordinates) but since nothing else is going on it won't trigger.  I did not see an event that can be dispatched from IVisualElement after it is completely drawn that I can use to call getRendererCoordinates.
    Any suggestions?
    Thanks again for your help and time,
    John

  • HT1766 how can i view my backed up items, including apps, and select specific items to restore back to my iPhone? i lost a lot of items when upgrading to iOS 6.0.1. thanks for any help.

    I have just updated an iPhone 4 to iOS 6.0.1 and lost a lot of the Apps that were on the phone. How do I get them back? Can I view my backed up items and select items to restore?

    You can restore the backup to get the apps back from the last backup
    Or you can re install them manually

Maybe you are looking for

  • If you can solve this problem, then you are a true iPod Classic Genius !

    So I have talked to every level at Apple's iPod support, and to list all the things they made me do would exceed the size limit of this message board. They even made me send back my original iPod Classic, and I had to wait for almost 1 month to recei

  • Is there any way to uncomact the inbox and go back to a folder with files in it?

    I am running Thunderbird 24.5.0 on Windows 7 Home Premium 64 bit. I let my inbox get rather big and Thunderbird decided to compact it, it seems to be just one file now. Now my virus checker says it has found a threat in the file InBox and wants to de

  • How do I replace the hard drive?

    I got a message that my internal hard drive is failing, and I need to back up the data I can and replace it. I'm running a 27' iMac and I can open any of the users except for the main one. The unit just freezes while booting, unless powered up in saf

  • Indian Rupee Symbol in Smartform

    Hi All I have got a requirement in which i need to use the recently announced Indian Rupee Symbol in my Smartform. I need to use it in the table being displayed in the Smartform, in front of the Amount in each row, i need to dispaly the symbol. I hav

  • Best way to manage iPod with large library

    Hello all. I have a nano, and my library is larger than the capacity for it. I use it primarily for Podcasting, but also put regular music on there as well. Whenever iTunes does its auto-sync, it always tries to put the whole library on my nano. Ther