Hi Everyone
I have a mail rule that is refusing to work in Mountain Lion
The script itself work when the mail is selected (set theMessage to selection and perform script)
but when the same script is incorporated in the mail rule it does not work.
I have saved the script as a script bundle scptd.
When i reach the debug point (see below) the is no file name in the dialog box. There is when I run the standalone script
Any ideas?
on perform mail action with messages these_messages for rule this_rule
tell application "Mail"
set the message_count to the count of these_messages
repeat with i from 1 to the message_count
set this_message to item i of these_messages
set thecontent to content of this_message
set splitcontent to paragraphs of thecontent
set splitcontent2 to words of thecontent
repeat with i from 1 to number of items in splitcontent
set this_item to item i of splitcontent
set underscoreCount to 0
if this_item contains "_" then
set textItemlist to every text item of this_item
repeat with i from 1 to number of items in textItemlist
set this_char to item i of textItemlist
if this_char is equal to "_" then
set underscoreCount to underscoreCount + 1
if underscoreCount is equal to underscore then
set thisLine to this_item
try
set extractFile to textstuff's deleteSpace(thisLine, deletelist)
set wordlist to words of extractFile
set theFile to item 1 of wordlist
DEBUG POINT ----------- display dialog theFile as string
Browser: Safari 534.55.3
Operating System: Mac OS X (10.7)