theNewItems
- это список из alias
спецификаторов.Сравнение этого типа со строкой всегда терпит неудачу.
Вы должны получить имя элемента и вы должны перебрать список файлов
on adding folder items to theAttachedFolder after receiving theNewItems
repeat with anItem in theNewItems
tell application "System Events" to set fileName to name of anItem
if "blah" is in fileName then
set theDialogText to "Blah in filename"
display dialog theDialogText buttons {"Continue", "Close"} default button "Close" with icon note
else if "lol" is in fileName then
set theDialogText to "Lol in file name"
display dialog theDialogText buttons {"Continue", "Close order"} default button "Close" with icon note
else if "ha" is in fileName then
set theDialogText to "Ha is in file name"
display dialog theDialogText buttons {"Continue", "Close"} default button "Close" with icon note
else if "omg" is in fileName then
set theDialogText to "omg is in file name"
display dialog theDialogText buttons {"Continue", "close"} default button "Close" with icon note
end if
end repeat
end adding folder items to