AppleScript 'loop' probleem
15 mei 2013 - 23:14   
geplaatst door: djgns
Hallo

Ik heb een applescript dat een bepaalde taak uitvoert bij het binnenkomen van een mail. echter als er meer dan 1 mail binnenkomt behandeld mail slecht 1 mail. Dus wou ik mijn script aanpassen en een repeat insteken maar hier loop ik vast...

Iemand die kan helpen?

Applescript dat aangeroepen is via een mail regel...


tell application "Mail"
 set tel to unread count of inbox
 repeat while tel > 0
   set theContent to content of (last message of inbox whose read status is false)
   end tell
   
   tell application "FileMaker Pro Advanced"
     activate
     try
       go to layout "klanten - zoeken"
       copy theContent to cell "zoekID"
       do script "Export klant via ID"
       show window "Hoofdscherm"
     end try
   end tell
   
   tell application "Mail"
   set read status of (last message of inbox whose read status is false) to true
   set tel to unread count of inbox
 end repeat
end tell

alvast bedankt!

Even wat zon nodig?? Vakantie in Tenerife
Informatie over energie, EPC, EPB? ...Energie-coördinator De Clercq
Bouwkundig of landmeetkundig advies? ...Ingenieursadvies De Clercq
AppleScript 'loop' probleem
15 mei 2013 - 23:35    reactie #1
geplaatst door: wimvanhelsdingen
Beste,

Ik doe dat anders:


using terms from application "Mail"
 on perform mail action with messages theselectedMessages for rule theRule
   
   tell application "Mail"
     repeat with theMessage in theselectedMessages
       
       --FileMaker Spul:
       tell application "FileMaker Pro"
         activate

         delay 2
       end tell

     end repeat
   end tell
 end perform mail action with messages
end using terms from

Let ook op de delay.....