deleteListに入っている数値に該当するものをリストから削除する

削除リストに入っている数値に該当するものをリストから削除するAppleScriptです。

削除リストには、削除対象データが入ります。

スクリプト名:deleteListに入っている数値に該当するものをリストから削除する
set deleteList to {1, 3, 5} –削除データリスト
set bbList to {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 10, 6, 10, 10, 10}

set bbbList to deleteNumfromListByDelList(bbList, deleteList) of me
–> {2, 10, 6, 10, 10, 10}

–指定のリストから削除指定リストに入っているアイテムを削除する
–こちらは、deleteListに入っている数値に該当するものを削除する
on deleteNumfromListByDelList(aList, deleteList)
  set newList to {}
  
repeat with i in aList
    set j to contents of i
    
if j is not in deleteList then
      set the end of newList to j
    end if
  end repeat
  
  
return newList
end deleteNumfromListByDelList

▼新規書類に ▼カーソル位置に ▼ドキュメント末尾に

Leave a Reply