Re: Bug introduced in Mail after Safari 5 install
Re: Bug introduced in Mail after Safari 5 install
- Subject: Re: Bug introduced in Mail after Safari 5 install
- From: Axel Luttgens <email@hidden>
- Date: Sun, 13 Jun 2010 17:48:20 +0200
Le 13 juin 2010 à 07:06:44, Brooks Bell a écrit :
> Apple has confirmed to me that it is a known bug in Safari 5. If you run
> the AppleScript I included earlier you will see the problem.
>
> My issue is that I have shipping software with this AppleScript that users
> depend on. The best bet right now seems to be to wait for Apple to fix it.
Seems to be a WebKit thing; I was wondering how an upgrade of Safari could impact Mail.app... ;-)
This is a rather strange bug, as it mainly impacts scripting commands such as "send", while the menu commands seem to behave (more or less) correctly. As a result, this is the only workaround I could devise:
tell application "Mail"
activate
tell (make new outgoing message with properties {visible:true, subject:"Hello!"})
make new to recipient with properties {address:"email@hidden"}
set content to "Hey!" & return & "Nice PDF attached." & return & return
make new attachment at after the last paragraph with properties {file name:"/path/to/some.pdf"}
end tell
end tell
delay 1
tell application "System Events"
tell application process "Mail"
keystroke "t" using {command down, shift down}
keystroke "d" using {command down, shift down}
end tell
end tell
It appeared that:
- the message's content must be set separately, not as a property passed to the make new outgoing message command
- the delay seems to be required, and that's always a bit annoying
- the message is more correctly formed when in plain text, hence the cmd+shift+T
- one needs to avoid the send command, hence the cmd+shift+D
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