Filling ActiveScript Variables with Textblock ?

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Filling ActiveScript Variables with Textblock ?

Post by amix » Fri Sep 28, 2007 8:59 pm

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 ?

Like:

Code: Select all

var txt = zeus.get_marked_contents();
?

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Fri Sep 28, 2007 10:39 pm

Doesn't this work :?:

Code: Select all

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

  ' put it into the clipboard
  zeus.set_clipboard_text(text)
End Function

key_macro() ' run the macro
Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Post by amix » Fri Sep 28, 2007 10:56 pm

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.

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Post by amix » Fri Sep 28, 2007 11:04 pm

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().

jussij
Site Admin
Posts: 2449
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij » Mon Oct 01, 2007 5:22 am

The document is wrong. The function will copy the entire marked area.

Cheers Jussi

amix
Posts: 49
Joined: Wed Aug 22, 2007 1:26 pm

Post by amix » Mon Oct 01, 2007 1:12 pm

Ok. Thanks.

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 3 guests