Re: Getting a string on the clipboard in OE
Re: Getting a string on the clipboard in OE
- Subject: Re: Getting a string on the clipboard in OE
- From: Nigel Garvey <email@hidden>
- Date: Mon, 30 Apr 2001 10:19:19 +0100
Jan Pieter Kunst wrote on Sat, 28 Apr 2001 20:27:25 +0200:
>
Nigel Garvey (email@hidden) schreef op 28-04-2001 19:37 :
>
>
> Therefore, to use an
>
> application's "copy" command, you have to activate the application; to
>
> use "set the clipboard to", you have to activate the script (or the
>
> application running it) to bring it to the front.
>
>
>
> tell me to activate
>
> set the clipboard to x
>
>
>
This did it. Thanks a million. I would never have thought of this myself. I
>
wasn't conceptualizing the script itself as a separate entity that needs to
>
be 'brought to the front' in certain circumstances.
Hi, Jan. I'm glad that helped. However, it occurred to me this morning
that what I said on Saturday about having to activate the script itself
is not necessarily true. If you've already activated the application
you're scripting (say Outlook Express), it should be possible to tell
*it* to 'set the clipboard'.
tell application "Outlook Express"
activate
-- Do stuff, including setting the variable 'x'
-- to some value obtained from the application
set the clipboard to x
end tell
Notice that 'set the clipboard' is in a 'tell' block addressed to the
active application. I don't have Outlook Express - so I can't try it with
that specifically - but it should work with any scriptable application.
It avoids the unsightly and time-consuming process of bringing the script
itself to the front.
>
Tricky stuff ...
Yes, sometimes - but it gets easier as you get used to it. :-) However,
the occasional tendency to give bad advice on mailing lists never quite
goes away.... :-\
NG