Get mail subject using applescript -


i'm writing script using mail applescript template (file > new template > mail > mail rule action.scptd) doesn't seem examples in template working

using terms application "mail"       on perform mail action messages these_messages rule this_rule                 tell application "mail"                           set message_count count of these_messages                           repeat 1 message_count                                     set this_message item of these_messages                                     try                                               set this_subject (subject of this_message) unicode text                                               if this_subject "" error                                     on error                                               set this_subject "no subject"                                     end try                             this_subject                           end repeat                 end tell       end perform mail action messages end using terms 

it says "no subject" if message has subject. i'm using os x 10.7.2 , mail 5.1. suggestions?

try adding delay 3 under set this_subject (subject of this_message) unicode text. may mail doesn't have time process message subject line before moving next command.

if works, may not need 3 seconds. can experiment decreasing delay time. note can use decimals, in 1.8.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -