0

AppleScriptアイテムのリストを作成しようとしていますが、追加するのは複数の単語を含む文字列です。リストのアイテム1を表示しようとすると、リスト内のすべてのアイテムになります。私は違いを生むかもしれない繰り返しからこれをやっています、しかし私は非常に混乱しているのであなたがそれを投稿するだけでうまくいくと思うものは何でも。ありがとう!!!

4

1 に答える 1

3

方法は次のとおりです。これは、2 種類の繰り返しループとその使用方法を示しています。幸運を!

set myList to {"some words", "more of them", "and a lot of words"}

repeat with i from 1 to count of myList
    set thisItem to item i of myList
    -- do something with thisItem
end repeat

-- or another way to do a repeat loop

repeat with anItem in myList
    set thisItem to contents of anItem
    -- Notice if we use a repeat loop like this (e.g. anItem) then anItem
    -- is just a reference to the words. To actually get the words
    -- we need to get the contents of anItem
end repeat
于 2012-12-11T05:46:49.430 に答える