SOLVED? Copy open files path & files name

Make a request or discuss new features.
Post Reply
akari
Posts: 22
Joined: 16 Aug 2013 09:07

SOLVED? Copy open files path & files name

Post by akari »

We have copy file path and file name function in RJ TextEd, but sometimes, when we open and edit a lot of files, it is better to have a function to list down all the open file, so we can easier write in working log.

e.g.
aa.php
bb.js
cc.css

or in file path
D://test/aa.php
D://test/bb.js
D://test/cc.css

User avatar
Rickard Johansson
Site Admin
Posts: 6000
Joined: 19 Jul 2006 14:29

Re: Copy open files path & files name

Post by Rickard Johansson »

You should be able to do this using a script. It could create a list of all files open and e.g. save them to the clipboard, or maybe a file?

This just feels like a very specific feature that most users will never have any use for.

akari
Posts: 22
Joined: 16 Aug 2013 09:07

Re: SOLVED? Copy open files path & files name

Post by akari »

Thank for the advice, never use scripts before, is there any tutorial/help file for it?
It is possible the script will tell me which is edited also?

User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: SOLVED? Copy open files path & files name

Post by pjj »

akari wrote:
28 May 2020 02:24
Thank for the advice, never use scripts before, is there any tutorial/help file for it?
Here you can get some pointers: viewtopic.php?f=19&t=4633&p=16318#p16318

As for the script itself, here's your starting point:

Code: Select all

// JScript
var i, docList;

docList = "";
howManyOpenDocuments = MainApp.DocumentCount;

if (howManyOpenDocuments > 1) {
    for (i = 1; i < howManyOpenDocuments; i++) {
        docList = docList + "\n" + Document.FileName;
        MainApp.NextDoc;
    }
}
docList = trim(docList);
Now docList contains list of open documents; you can copy it to clipboard:

Code: Select all

Clipboard.AsText = docList;
or save as file:

Code: Select all

WStrings.SetText();
WStrings.SaveToFile("D:/doclist.txt");
Hope that helps :wink:
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

Post Reply