Userscript copy paste content to another file

Hello, i am reading documentation of macro to create a a userscript i have few questions first :

Can i copy a selection from one file ( example file_1.html )
and paste the content of buffer in a second file ( file_2.txt ) with a userscript ?

You’d have to get a bit crafty, but it’s possible.

You can use the following to get a view for a given URI:

ko.views.manager.getViewForURI()

Or you can get all views and go over them manually:

ko.views.manager.getAllViews()

Then you can make the view active with

view.makeCurrent()

After which you execute the paste command like you normally would:

ko.commands.doCommand("cmd_paste")

Alternatively you could manually insert the text through manual processing with the ko/editor SDK:

var editor = require("ko/editor").editor(view.scintilla, view.scimoz);

Documentation for SDK:

http://docs.komodoide.com/SDK/api/commonjs/editor

The Console widget (bottom pane) is a great place to try out all of this stuff.

okay i will test this and read this doc.