Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9737

    derekcohen
    Participant

    I’d like a macro to copy the name of a file to the clipbaord by an option added to the context menu if possible.

    This could be from the open documents list or from the projects list or from the file editor pane (or all of them).

    Ideally I’d like the file name without the path.

    thanks

    Derek

    #9738

    derekcohen
    Participant

    worked it out:

    document.CopyFullName();
    var fn=clipboardData.getData(‘Text’);
    fnArray=fn.split(”);
    clipboardData.setData(“Text”,fnArray[fnArray.length-1]);

    Is there an API reference anywhere?

    thanks

    Derek

    #9739

    Stefan
    Participant

    Hi Derek.

    derekcohen wrote:

    Is there an API reference anywhere?

    I think EmEditor Help (F1) > Macro Reference
    is what you search for.

    So here is my solution:
    EmEditor Help > Macro Reference > Document Object > Properties: Name Property

    clipboardData.setData(“Text”, document.Name );

    _

    There are also
    document.FullName
    document.Path
    and many more…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Share with friends... Tweet about this on TwitterShare on FacebookShare on Google+Email this to someone