AppleScript : repeat with each item from end to beginning I'm trying to do a repeat form a list but I would to repeat from the last item of the list to the newest instead of the another way.

How can I do that knowing that this will do in the wrong order :

   repeat with each from 2 to count of items of creationDate
        --
    end repeat


What I'm trying to do is to return the item number of the latest item which content the text "whatever"

Update 

repeat with anItem from 1 to count of items of (reverse of creationDate)
    set xitemOnMyList to item anItem of (reverse of xID) as text
    set trustitemOnMyList to item anItem of (reverse of trustSource) as text
    set dateitemOnMyList to item anItem of (reverse of creationDate) as text

    if xID contains xNumber and trustitemOnMyList is equal to "whatever" then
        set myResult to dateitemOnMyList
    else
        --
    end if


end repeat



  Can’t make item 14 of reverse of
You didn’t mention the contents or how your lists interact, but there are a few ways to start from the end of a list:

set creationDate to {"now", "later", "yesterday", ”whatever", "never"}

repeat with anItem from (count creationDate) to 1 by -1 -- step backwards
  log "Item:  " &amp; item anItem of creationDate
  log "Index: " &amp; anItem
end repeat

repeat with anItem from -1 to -(count creationDate) by -1 -- negative index
  log "Item:  " &amp; item anItem of creationDate
  log "Index: " &amp; anItem
end repeat

repeat with anItem from  -(count creationDate) to -1 — reverse items
  log "Item:  " &amp; item anItem of (reverse of creationDate)
  log "Index: " &amp; -anItem -- normal index into the original list
end repeat

repeat with anItem from 1 to (count creationDate) -- reverse items
  log "Item:  " &amp; item anItem of (reverse of creationDate)
  log "Index: " &amp; -anItem -- negative index into the original list
end repeat


The kind of indexing and size of the lists used needs to be consistent across multiple lists or you can run into errors with out of bounds items.