Page 1 of 1

Filling ActiveScript Variables with Textblock ?

Posted: Fri Sep 28, 2007 8:59 pm
by amix
I am writing a script, that either takes the currently marked block of text and constructs a HTML file with it, which then will be run in IE, or, if no mark set, it marks the whole text and constructs the HTML from that.

There is no way to access the Clipboard with ActiveScript. I did not find a COM or WSC doing this, either.

The only possibility seems to use temporary textfiles, that I then load via WSH and glue together.

Would it be a lot of work to add a possibility for filling a script-variable with the contents of the marked block ?


Code: Select all

var txt = zeus.get_marked_contents();

Posted: Fri Sep 28, 2007 10:39 pm
by jussij
Doesn't this work :?:

Code: Select all

Function key_macro()
  'get the marked text 
  text = zeus.macro_tag("$M")

  ' put it into the clipboard
End Function

key_macro() ' run the macro
Cheers Jussi

Posted: Fri Sep 28, 2007 10:56 pm
by amix
Yes, you're right. I just discovered the get_clipboard_text() a few minutes ago. Actually I saw it before, but I thought that this would paste. Sorry.

Posted: Fri Sep 28, 2007 11:04 pm
by amix
Oops, nope, I was too quick. ;-)

It should actually work with get_clipboard_text() rather than the $M MacroTag, since that, according to the documentation, only retreives a single line max.

What I need to do is to store a whole block in a buffer, but as it seems I can do this by copying it and then using get_clipboard_text().

Posted: Mon Oct 01, 2007 5:22 am
by jussij
The document is wrong. The function will copy the entire marked area.

Cheers Jussi

Posted: Mon Oct 01, 2007 1:12 pm
by amix
Ok. Thanks.