Pages

Affichage des articles dont le libellé est AppleScript : Lists. Afficher tous les articles
Affichage des articles dont le libellé est AppleScript : Lists. Afficher tous les articles

2 juin 2008

Remove duplicate items from a list

on removeDuplicateItem(theList)
set newList to {}
repeat with theItem in theList
if theItem is not in newList then set newList to newList & theItem
end repeat
return newList
end removeDuplicateItem


>>Ouvrir le script dans l'éditeur

Item number in a list


on ItemNumber(theItem, theList)
repeat with NumItem from 1 to count theList
if theItem = item NumItem of theList then return NumItem
end repeat
return 0
end ItemNumber

>>Ouvrir le script dans l'éditeur

Convert a string to a list

on text2List(theText, theDelimiter)
set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, theDelimiter}
set theList to every text item of theText
set AppleScript's text item delimiters to tid
return theList
end text2List

>>Ouvrir le script dans l'éditeur