0
나는 같은 AppleScript로 레코드 목록이 있습니다필터 AppleScript를 기록
:set mylist to {}
repeat with i from 1 to 8
set mylist to mylist & {{group:round (i/3), info:i}}
end repeat
내가 좋아하는 뭔가 기록 목록을 분할 특정 속성 값으로 레코드를 필터링하고 싶습니다를
set group_values to {}
repeat with rec in mylist
if group of rec is not in group_values then
set group_values to group_values & (group of rec)
end if
end repeat
set r to {}
repeat with group_value in group_values
set by_group to {}
repeat with rec in mylist
if group of rec is equal to contents of group_value then
set by_group to by_group & {contents of rec}
end if
end repeat
set r to r & {by_group}
end repeat
은 내가이 있는지 알고 싶습니다
{{{group:0, info:1}},
{{group:1, info:2}, {group:1, info:3}, {group:1, info:4}}
{{group:2, info:5}, {group:2, info:6}, {group:2, info:7}}
{{group:3, info:8}}}
은이 코드 내 필터링 된 목록을 가지고 속성 값별로 레코드를 필터링하는 간단한 방법. 이것은 조금 빠른