Re: Paste Text Into Mail
Re: Paste Text Into Mail
- Subject: Re: Paste Text Into Mail
- From: Timothy Bates <email@hidden>
- Date: Mon, 7 Sep 2009 13:24:35 +0100
The bug of not having a selection is so many years old, I doubt they
will ever fix it.
UI scripting is painful.
Ergo, if it were me I would type some unlikely string at the insertion
point, then replace it
User simply types "zzz", calls your script... your script then just says
old = contents of email
new = echo str_replace("zzz", sig, old)
contents of email = new
(you can see i have largely moved to php in my work :-) )
tim
On 7 Sep 2009, at 11:48 AM, Simon Forster wrote:
Hi
Having been away from this list for a while I return with the
simplest of questions. How do I insert text into the current Mail
message at the cursor? I've thrashed around for a while now and
ended up with setting the clipboard and then pasting (tell
application "System Events" to keystroke "v" using {command down}).
Very inelegant and alters the current contents of the clipboard -
which may be a pain.
Any insight?
The whole story is that I've got bored of Mail dumping the signature
where it sees fit so I'd like to get a service up and running so
that right clicking in Mail allows me to drop the sig at the current
cursor position. It'll save me hours each week.
I've sort of got this working using Automator and AppleScript but:
1) It uses the nasty paste example above.
2) I don't seem to understand how to get Mac OS to display the
action in a contextual menu - unless I get Automator to expect an
input (i.e. tick the appropriate box in Automator and then select
text before inserting the sig). Not ideal - especially as then I've
got to select text before it works.
I may be missing the obvious here (but the paste signature before
quoted text in prefs isn't it. Depending on the audience I may be
top posting, bottom posting or inserting stuff inline. My prefs. My
workflow. Please respect that and don't get knickers into twist wrt
the one true way to quote text in a mail message.)
Mac OS 10.6 if that makes a difference.
TIA
Simon Forster
LDML Ltd
t: +44 20 7993 8813
m: +44 79 0528 8198
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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