• 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
Re: Send outgoing message error from Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send outgoing message error from Mail.app


  • Subject: Re: Send outgoing message error from Mail.app
  • From: Alan Kimelman <email@hidden>
  • Date: Tue, 2 Feb 2010 11:32:35 -0800

Axel, 
Thanks for your UI script to change the subject of an outgoing message. 

I have  however experienced a problem with the  Mail UI script when it follows  the following Safari script:

 tell application "Safari"
tell front window
tell current tab
set HTML_Tab_Name to name
email contents
end tell
end tell
end tell

Although the Safari  applescript  to 

email contents 

commands Mail to display the html contents of its Safari tab, it also commands Mail to set the subject  of the outgoing message to the name of the Safari  tab. Modifiying your UI script, I have been able to  replace the value of an  outgoing message subject with the following script:

tell application "System Events"
tell application process "Mail"
set value of text field "Subject:" of front window to "New Subject"
end tell
end tell

To my surprise, the  Safari applescript command

email contents 

 continued on its own. If Safari emailed  contents of  a long html page,  then even though the UI  script  changed the subject line, the Safari 

email contents

command replaced  it,  I guess asynchronously. This occurred even  when the UI script  changed the subject back  to the name of the Safari's tab. What the UI script performed, the email contents script reversed.

Can the UI script be commanded to wait until  the  Safari 

email contents 

 command has completely finished its execution?  


On Feb 1, 2010, at 6:01 AM, Axel Luttgens wrote:

Le 31 janv. 2010 à 23:34:37, Alan Kimelman a écrit :

Axel,

Your UI script solved the problem of sending an outgoing message that had been  generated by Safari's  applescript  command  to email contents.
Thank you for your help.

Along a similar vein, I am having difficulty changing the name of the subject in the outgoing message. The script you suggested, along with  other attempts I have made to change outgoing message's subject,  have failed to change the name.
The method employed by Safari applescript is to make the subject of the outgoing message the same text or value  as the title of the HTML page in Safari . In your script example that would be  N.

How might I find a method to change the subject in the outgoing message?

Mmm... I secretly hoped you wouldn't need to do that. ;-)

This is the kind of problematic access to the properties of an "external" outgoing message I alluded to in a previous mail. In fact, it is even surprising that "make new recipient..." works in that case.

Anyway, let's explore the UI items exposed by a window displaying an outgoing message; assuming that such a window is the frontmost in Mail, let's run:

tell application "System Events"
tell application process "Mail"
UI elements of front window
--> {..., text field "Objet :" of window "Re: Send outgoing message error from Mail.app" of application process "Mail" of application "System Events", ...}
end tell
end tell

Fine, it seems that the field of interest isn't deeply nested in some complicated window organization. After some experiments (and surprises - for example, the field can't be accessed by name):

tell application "Mail" to activate
tell application "System Events"
tell application process "Mail"
tell front window
tell text field 1
set focused to true
keystroke "Sample message object"
end tell
end tell
end tell
end tell


HTH,
Axel


 _______________________________________________
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

References: 
 >Re: Send outgoing message error from Mail.app (From: Axel Luttgens <email@hidden>)

  • Prev by Date: set position does not works "as is"
  • Next by Date: Re: problem with perform mail action
  • Previous by thread: Re: Send outgoing message error from Mail.app
  • Next by thread: Re: non-existant app
  • Index(es):
    • Date
    • Thread