2012-12-11 2 views
0

나는 appescript 항목 목록을 갖고 자 노력하고 있는데, 내가 추가하는 것은 여러 단어가 포함 된 문자열입니다. 보려고하면 목록의 항목 1을 말하게되고 결국 목록의 모든 항목이됩니다. 나는 차이를 만들지도 모른다 반복에서 이것을하고있다 그러나 나는 당신이 다만 그것을 배치하는 생각하는 무엇이든을 그래서 배치한다 아주 혼동된다. 감사합니다 !!!문자열 목록 applescript

답변

3

다음은 어떻게 사용하나요? 여기에는 두 가지 유형의 반복 루프와이를 사용하는 방법이 표시됩니다. 행운을 빕니다!

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 
+0

목록의 끝에 다른 항목을 추가하는 올바른 방법을 알고 계십니까? – user1685192

+0

myList의 끝을 "다른 항목"으로 설정 ... 여기 (http://macscripter.net/viewtopic.php?id=25631)로 이동하여 "초보자 용 AppleScript 자습서"라는 자습서를 수행해야합니다. 그것은 내가 배운 방법입니다. 목록에 하나 있습니다. – regulus6633