Need help with AppleScript that won't work properly in El Capitan

Joined
Oct 16, 2010
Messages
17,555
Reaction score
1,580
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
As the subject says, I can't get a SpamCop applescript that I've used successfully for years, right up to and including Mavericks 10.9.5 working properly with Mail.app in El Capitan.

The script is the "SpamCopNotify.scpt" that was created by a recommended scripter by SpamCop, and to be used with Apple Mail.

The problem is when used with El Capitan 10.11.6, the email gets sent but it doesn't include the normally enclosed attached "forward.emi" attachment that contains the required SPAM text and headers etc.

I'm sure no script expert and I can't see why it won't add the attachment file to the email using El Capitan but works fine using Mavericks.

I've included the script text below if any script guru would like to take a look and see if they can let me know what the problem might be.

Oh yes, I've also tried disabling El Capitan's SIP protection but it doesn't help, but it's all I could think of that might be goofing up the script from working properly.

The SpamCopNotify.scpt file's Script is: (My spamcop addess has been removed)

set mySubmissionAddress to "submit.[MySpecialSpamCopAddressGoesHere]@spam.spamcop.net"
set sourceFile to ":tmp:forward.eml"
tell application "Mail"
set theMessages to the selection
repeat with thisMessage in theMessages
set thisSource to the source of thisMessage as string
set f to open for access sourceFile with write permission
set eof of f to 0
write thisSource to f
close access f

set newMessage to make new outgoing message at end of outgoing messages
set content of newMessage to ""
tell newMessage
set subject to thisMessage's subject
make new to recipient with properties {address:mySubmissionAddress}
tell content to make new attachment with properties {file name:sourceFile as alias} at after the last paragraph
end tell
set read status of thisMessage to true
set junk mail status of thisMessage to true
--set visible of newMessage to true
send newMessage
--display dialog sender of newMessage
delete thisMessage
end repeat
end tell
do shell script "rm -f '/tmp/forward.eml'"

Any constructive help or information would be appreciated to get this script working with Mail.app in El Cap'n.




Thanks,
- Patrick
======
 
OP
pm-r
Joined
Oct 16, 2010
Messages
17,555
Reaction score
1,580
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
Hmmm…??? No need to bump this as not one reply even after 58 views, so I guess there are no AppleScript/programmers that might have a suggestion as to the problem.

Too bad, I was hoping for some support or help.

And why would Apple's own applescript code fail with a later OS X version????

I sort of suspect some security or sandboxing violation but I tried disabling SIP and it still doesn't work.

Maybe I can see if my old local HyperCard guru friend has some idea if he ever gets home from all his boating in his newfound retirement!!!

But any input from any members here sure welcome.

Right now it just adds yet another reason for me to stay using Mavericks. At least it works.





- Patrick
======
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top