I was on vacation for 2.5 months (hehe) and this script no longer works for some reason. It works from the AppleScript Editor, but not from Mail.app. Any insight appreciated how to fix it.
Cheers
tell application "Safari" to set myLoc to the URL of document 1
set the clipboard to myLoc
tell application "Mail" to activate
tell application "System Events" to tell process "Mail" -- GUI Scripting
keystroke "v" using command down -- ⌘V to paste the URL
keystroke return
keystroke return
-- keystroke return
end tell
tell application "Safari" to set myLoc to the URL of document 1
tell application "Mail"
activate
set mymail to make new outgoing message at the beginning of outgoing messages with properties {content:myLoc & return & return}
set visible of mymail to true
activate
end tell
Tried some other stuff, and it’s still not working. Using a dialog display, the clipboard gets the value. I ask Mail to become active, but it won’t paste.