• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Problems with AppleScript under Ventura
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with AppleScript under Ventura


  • Subject: Problems with AppleScript under Ventura
  • From: Jenni via AppleScript-Users <email@hidden>
  • Date: Fri, 15 Sep 2023 07:42:10 -0700

        I have another AppleScript that no longer works as expected on my
new-to-me Mac.  It used to work under Catalina on an Intel iMac.  It's called
from within FMPro, but it doesn’t work from Script Debugger either.

        The script creates a new Mail message, sets its priority, and finally
places the cursor at the end of the message for me to enter any additional
info.  However, I’m now having 2 problems:

1] I can’t get the cursor to be placed in the body of the email anymore
2] when selecting "Make Plain Text”, the Quote Level is inadvertently being
incremented also (very strange)

        My searches haven’t turned up a workable solution.  Any and all help is
appreciated.

Thanks,
Marc

M1 MacBook Pro
Ventura 13.5


————————

set to_address to "email@hidden"
set the_priority to “high"
set text_style to "plain"
set from_address to "Test Co <email@hidden>"
set the_subject to "Test Email"
set the_body to "Paragraph 1.

Paragraph 2.

Paragraph 3."

tell application "Mail"
        with transaction -- Prevents other Apple Events from talking to FMPro
while this xaction is running.
                activate
                set new_message to make new outgoing message with properties ¬
                        {sender:from_address, subject:the_subject,
content:the_body as rich text}
                tell new_message
                        set visible to true
                        make new to recipient at end of to recipients with
properties ¬
                                {address:to_address}
                end tell

                delay 1 -- The move cursor lines wouldn’t work w/o a delay of
at least 1 second under Catalina.

                tell application "System Events"
                        tell process "Mail"
                                set line_count to count paragraphs of the_body
                                -- Place cursor in the body.  How???
                                set frontmost to true
                                if the_priority is equal to “high" then
                                        click menu item "High" of menu 1 of
menu item "Set Priority" of menu "Message" of menu bar 1
                                        delay 0.5
                                end if
                                if text_style = "plain" or text_style = "text"
then
                                        try
                                                click menu item "Make Plain
Text" of menu "Format" of menu bar 1
                                                delay 0.5
                                        end try
                                end if

                                set focused of scroll area of window 1 to true
-- (This no longer works.)
                                -- Move cursor down to the bottom of the body.
                                repeat line_count times
                                        key code 125 using option down -- Move
cursor down one line N times.
                                end repeat

                        end tell
                end tell
        end transaction
end tell

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Problems with AppleScript under Ventura
      • From: Ralph Richardson via AppleScript-Users <email@hidden>
  • Prev by Date: Re: How to open a file for writing?
  • Next by Date: Re: Problems with AppleScript under Ventura
  • Previous by thread: Re: How to open a file for writing?
  • Next by thread: Re: Problems with AppleScript under Ventura
  • Index(es):
    • Date
    • Thread