|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sat Mar 29, 2003 8:51 pm
%clip() and %selected does not capture ANSI |
When i use %clip() or %selected to capture highlighted or selected text it does capture the ANSI control codes. Is there a way for me to do this?
the help file for the stripansi function indicates that the %clip() function would capture the ansi information.
#SHOW %stripansi( %clip())
when I try to use %clip() in triggers,aliases or at the command line
it only captures the text.
any insight into how to accomplish this would be most appreciated.
Dharkael |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Mar 30, 2003 1:26 am |
The help entry for %stripansi doesn't say that %clip captures ANSI codes. What %clip does is set or return the contents of the clipboard. If happens that the contents of the clipboard has ANSI codes, then passing the output of %clip to %stripansi would remove these codes. That is all that the help says and it does not explain how the ANSI codes got there in the first place, it only assumes that they are there.
As it is right now, I don't think that there is a way to get the ANSI codes fo a portion of text you have selected (especially since nothing guarantees zMUD that the text you have selected does in fact contain ANSI codes and ti is not merely colored because of some previous ANSI code that is not selected). Anyway, what are you trying to do? There might be another way to do it, and if there isn't then you could make a suggestion to Zugg.
Kjata |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Sun Mar 30, 2003 3:31 am |
The help for %clip and %stripansi
doesnt say much at all, though the help for
%stripansi is rather suggestive.
When one copies from the session window in Zmud
and pastes into the command line of a trigger that has ansi trigger selected or if one pastes into the zMud editor the clipboard seems to retain the ansi information so apparently the clipboard does have someway to capture this information but it appears that there's no way for me to get this programmatically.
Anyways what I'm trying to do is capture programmatically the text that I've copied to the clipboard or merely highlighted, with its ansi information intact.
if its not possible currently it could be done by simply allowing %selword %selline
%selected and %clip() to retain any ansi information and those not interested in that could use the %stripansi function.
Anyways I'm hoping there is way.
Dharkael |
|
|
|
virtuous Wanderer
Joined: 08 Jan 2003 Posts: 60
|
Posted: Sun Mar 30, 2003 6:32 am |
Ansi information is retained 1) if you have a color syntax, and you copy it into the command line, and 2) if you paste it into a trigger with the Ansi Color option selected. Apparently there are three different transfer-from-screen-to-clipboard functions: color-syntax version, Ansi-trigger version, and script version. Perhaps if the two former versions were available in script as well...
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Mar 30, 2003 3:38 pm |
Open the Clipboard Viewer after copying some text with ANSI codes. You will see that the text does not have the ANSI codes. My guess is that zMUD does some special tricks when copying and pasting into either a trigger pattern or zMUD's editor.
As far as I know, there is not way to get the ANSI codes of what you have selected. You might make a suggestion to Zugg about it, though.
Kjata |
|
|
|
|
|