I've done it this way
Code: Select all
filter field someField with "*jpg"
I want to know is it possible to filter the field with more extensions, like .jpg, .png... I've tried to find it out but i couldn't?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
filter field someField with "*jpg"
Code: Select all
set the itemDelimiter to "."
put "jpg" & return & "jpeg" & return & "png" into myFormatList
put "1" into x
repeat
put last item of line x of field "someField" into myFormatExtension
put "no" into passTest
repeat with y = 1 to the number of lines of myFormatList
if myFormatExtension is line y of myFormatList then put "yes" into passTest
end repeat
if passTest is "no" then
delete line x of field "someField"
else
add 1 to x
end if
if (x > the number of lines of field "someField") or (field "someField" is empty) then exit repeat
end repeat