Results 1 to 4 of 4
  1. #1


    Member Since
    Sep 06, 2008
    Posts
    5
    Applescript for sending selection as new Mail
    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:
    Code:
    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:

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Hit the return key after the "end run" line. And here I thought that was a Microsoft issue.

    Also you might want a line gap between the URL and the body so here is a hint;
    Code:
    	-- define our carriage return and line feed
    	set CLRF to (ASCII character 13) & (ASCII character 10)
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  3. #3

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    Attached is a screen shot of my solution. I rely that this is for Safari only.
    Attached Images Attached Images
    CameraTime - Time lapse photography for novice and advanced users.

    When asking questions, post the version of your software. You'll receive better answers.

    Please post your results to the thread as it is good feedback.

  4. #4


    Member Since
    Sep 06, 2008
    Posts
    5
    thx for your replies

    what i finally did was something similar.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-23-2015, 03:39 PM
  2. Mac's Mail Program Sending E-mail As SPAM
    By amyzingxcomica in forum Switcher Hangout
    Replies: 1
    Last Post: 03-21-2012, 09:32 PM
  3. Replies: 0
    Last Post: 02-20-2012, 07:21 AM
  4. Mail: Popup to choose account when sending e-mail
    By SVA in forum OS X - Apps and Games
    Replies: 0
    Last Post: 10-09-2011, 01:53 PM
  5. Mail not playing sound effect when sending mail
    By Straitsfan in forum OS X - Operating System
    Replies: 3
    Last Post: 11-06-2008, 11:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •