gurth4ng Posted September 17, 2009 Share Posted September 17, 2009 Hello. What i'm trying to achieve is adding an option to Safari for getting the selected text and sending it to Mail as the content of a new email message, along with the website's url. The already available action "New Mail Message" is able to do half of what i'm asking: it can send my selection to Mail as the content of a new emal message, but nothing more. I'm trying to compose an Applescript to run from within my Automator Service, but i'm getting an error: The action "Run AppleScript" encountered an error. Any ideas? Here is the script i'm using: on run {input, parameters} set myBodyText to value of variable "mySelection" of front workflow set siteURL to value of variable "mySiteURL" of front workflow tell application "Mail" make new outgoing message with properties {visible:true, subject:"Something Interesting", content:"" & siteURL & myBodyText} end tell return input end run And here is a screenshot of my Automator Workflow: Link to comment Share on other sites More sharing options...
Sphere777 Posted February 12, 2010 Share Posted February 12, 2010 You find a resolution for this? I'm having the exact same issue. Hello. What i'm trying to achieve is adding an option to Safari for getting the selected text and sending it to Mail as the content of a new email message, along with the website's url. The already available action "New Mail Message" is able to do half of what i'm asking: it can send my selection to Mail as the content of a new emal message, but nothing more. I'm trying to compose an Applescript to run from within my Automator Service, but i'm getting an error:The action "Run AppleScript" encountered an error. Any ideas? Here is the script i'm using: on run {input, parameters} set myBodyText to value of variable "mySelection" of front workflow set siteURL to value of variable "mySiteURL" of front workflow tell application "Mail" make new outgoing message with properties {visible:true, subject:"Something Interesting", content:"" & siteURL & myBodyText} end tell return input end run And here is a screenshot of my Automator Workflow: Link to comment Share on other sites More sharing options...
gurth4ng Posted February 13, 2010 Author Share Posted February 13, 2010 You find a resolution for this? I'm having the exact same issue. I've gotten to a point where it works, but it doesnt work as i would like so i abandoned it. What i did, was use this following Applescript: on run {input, parameters} set selectedText to item 1 of input tell application "Safari" tell document 1 set pageURL to URL end tell tell window 1 tell current tab set pageTitle to name end tell end tell end tell tell application "Mail" activate make new outgoing message with properties {visible:true, subject:"Αποστολή Άρθρου: " & pageTitle, content:"" & return & pageTitle & return & return & return & return & selectedText & return & return & return & return & return & return & pageURL} end tell end run what it does, is: it takes your selection from Safari it takes the page's title and url it create a new Mail message using the title as the msg's topic it adds in the message body your selection, along with the page's url While it works, the problem is that it doesnt add any images or formatting from the webpage, so it's only good to copy plain text. I guess there must be a way to fix this, but i got kinda tired with it to be honest. If you find anything, please tell me Link to comment Share on other sites More sharing options...
Recommended Posts