• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I make words list from two lists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I make words list from two lists?


  • Subject: Re: How do I make words list from two lists?
  • From: Shane Stanley via AppleScript-Users <email@hidden>
  • Date: Sun, 22 Sep 2019 23:53:26 +1000

On 22 Sep 2019, at 10:35 pm, Noriaki Fujita via AppleScript-Users
<email@hidden> wrote:
>
> This is the method I thought of myself.

I think you're over-complicating things a bit. Why not:

set alist to {"T", "h", "e", "q", "u", "i", "c", "k", "b", "r", "o", "w", "n",
"f", "o", "x"}
set bList to {1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4}

set string_list to {}
set lastStart to 1
repeat with n from 2 to count bList
        if item n of bList > item (n - 1) of bList then
                set end of string_list to (items lastStart thru (n - 1) of
alist) as text
                set lastStart to n
        end if
end repeat
set end of string_list to (items lastStart thru -1 of alist) as text

return string_list


--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: How do I make words list from two lists?
      • From: Jean-Christophe Helary via AppleScript-Users <email@hidden>
References: 
 >How do I make words list from two lists? (From: Noriaki Fujita via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: How do I make words list from two lists?
  • Next by Date: Re: How do I make words list from two lists?
  • Previous by thread: Re: How do I make words list from two lists?
  • Next by thread: Re: How do I make words list from two lists?
  • Index(es):
    • Date
    • Thread