Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot use older (2021) apple script to send message from Mail Application

I have a DB where I keep scripts that I used in the past.  I now would like to use one of those and it hangs on one line.  I tried other ones I have, and they all hang on the same line.  See pic.  


They all hang on the same line at the same word.

 

set theMessage to make new outgoing message…

 

The word message is where they hang.


I also went on the internet and found some scripts.  They all hang at the same place.  Here is my script as a test.

 

set recipientName to "Test"
set recipientAddress to "name@123.com"
set theSubject to ((do shell script "date '+%d-%m-%Y at %T'") & (" - Test"))
set theContent to "test"
 
tell application "Mail"
    
    ##Create the message
    set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
    
    ##Set a recipient
    tell theMessage
        make new to recipient with properties {name:recipientName, address:recipientAddress}
        
        ##Send the Message
        send
        
    end tell
end tell

 

any idea as to why and how to fix?  


MacBook Pro Apple Silicon

Posted on Dec 23, 2022 4:46 AM

Reply

Similar questions

7 replies

Dec 23, 2022 8:01 AM in response to ChangeAgent

There have been instances in the past with Big Sur and Monterey where code in the Script Editor stopped working even when it would compile, and as a last resort, a reboot resolved it. If this happens again, you might consider quitting Script Editor and then holding the shift key when relauncing it to see if it behaves. The shift key prevents it from loading its last execution state, and may be a simpler fix than a reboot. Or it may not.

Dec 24, 2022 1:14 AM in response to VikingOSX

VikingOSX wrote:

... quitting Script Editor and then holding the shift key when relauncing it to see if it behaves. The shift key prevents it from loading its last execution state, and may be a simpler fix than a reboot. Or it may not.

I tested that today. I created a script did not safe it and quit Script Editor. Now do I understand you correctly that Script Editor should not open in the previous sate? Should the unsaved script I created not open but disappear? Or do I understand you incorrectly?

Cannot use older (2021) apple script to send message from Mail Application

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.