Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to send an email about a page in Safari' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to send an email about a page in Safari
Authored by: tomschmidt on Feb 06, '08 10:33:47AM

For some unknown reason, 2 backslashes have disappeared from one line of this script. In the "tell myEmail" statement near the end of the script, the second line should read, "set content to ("\"" & SelectedText & "\"" & return & return & "More at " & PageURL)". As brucio observes, without the backslashes there will be a syntax error.

Also, thanks robg for pointing out the correct place to put the script!



[ Reply to This | # ]
An AppleScript to send an email about a page in Safari
Authored by: vwgtiturbo on Feb 06, '08 11:05:29AM

Good point. Removing the " worked, but this way is the intended use, I suspect, as it puts quotes around the selected text (and my misinformation of removing the third " adds the selected text to the body of the email, but without quotes). Obviously, I am a rookie :)



[ Reply to This | # ]
An AppleScript to send an email about a page in Safari
Authored by: brucio on Feb 06, '08 11:19:34AM
Yikes! Now I get an Applescript error: "Mail got an error: NSReceiverEvaluationScriptError: 4"

with "index" highlighted at "set index to 1"

Any ideas what that's about?

[ Reply to This | # ]

An AppleScript to send an email about a page in Safari
Authored by: egoham on Feb 06, '08 11:39:07AM

I get that error if I Run the script from Script Editor. However, if run from the Scripts menu in the menu bar the error is not generated.

I still have problems with the script.

I corrected the contents back to the original script with the additions of the backslashes, noted by the OP. Complies just fine. Save it.

Highlight some text in Safari. Run the script, Mail comes to the front. Doesn't create a new message.



[ Reply to This | # ]
An AppleScript to send an email about a page in Safari
Authored by: brucio on Feb 06, '08 01:06:01PM

Yes, I was trying to run it from Script Editor. Fixed. But now I have the same problem; Mail.app comes to front, but no message.



[ Reply to This | # ]
An AppleScript to send an email about a page in Safari
Authored by: tomschmidt on Feb 06, '08 12:05:09PM

I can't respond to the "Mail got an error: SReceiverEvaluationScriptError: 4" issue or the message not created problem, since the script works on my machine. For what it's worth, I use Script Editor 2.2, Applescript 2.0, and OS X 10.5.1.



[ Reply to This | # ]