2016-04-05 20 views
0

ile Mail seçimden iletilerin bir listesini almak için nasıl çalışır:AppleScript

tell application "Mail" 
set x to every message in inbox whose subject contains "deal" 
end tell 

Şimdi Geçerli seçimi kullanarak aynı yapmak istiyorum, ama bu işe yaramazsa:

tell application "Mail" 
set x to every message in selection whose subject contains "deal" 
end tell 

hata alıyor "Postada bir hata var: Konusu, \" anlaşma \ "içeren türdeki her iletiyi tür belirticisine yapamaz." sayı -1700 için belirteci

Neyi eksik?

cevap

2

selection özelliğinde whose maddesini kullanamazsınız.

Çözüm, bir tekrar döngü

tell application "Mail" 
    set theMessages to selection 
    set filteredMessages to {} 
    repeat with aMessage in theMessages 
     if subject of aMessage contains "deal" then set end of filteredMessages to contents of aMessage 
    end repeat 
end tell 
olduğu
İlgili konular