Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Here is my Perl module for automating Notepad++ (the Windows-based text editor). edit: as new versions are released, I will update the VERSION HISTORY, and post a reply so something ends up in Newest Nodes / Recently Active Threads


NAME

Win32::Mechanize::NotepadPlusPlus - Automate the Windows application Notepad++

SYNOPSIS

use Win32::Mechanize::NotepadPlusPlus ':main'; my $npp = notepad(); # main application

DESCRIPTION

Automate the Windows application Notepad++. This is inspired by the Notepad++ plugin PythonScript, but I decided to automate the application from the outside, rather than from inside a Notepad++ plugin. But this module uses similar naming conventions and interface to the PythonScript plugin.

LIMITATIONS

This is the first public release of the module. In general, it works. As with all first releases, there is room for improvement; I welcome feedback.

The first known limitation is that none of the hooks for Scintilla or Notepad++ callbacks have been enabled. That may come sometime in the future.

All the testing and development was done with a US-English installation of Notepad++, and all the file encodings have been ANSI or UTF-8. I know that I need to include better tests for encoding, and any help you can provide with that is appreciated.

Notepad++ is a Windows application, so that's the intended platform for this module. However, I know Notepad++ can be made to run in Wine and similar environments in Linux, so it may be possible to make this module drive Notepad++ in such an environment. Feedback on this process is welcome.

INSTALLATION

To install this module, use your favorite CPAN client.

For a manual install, type the following:

perl Makefile.PL make make test make install

(You may need to use "dmake" or "gmake" instead of "make", depending on your setup.)

AUTHOR

Peter C. Jones

Please report any bugs or feature requests thru the repository's interface at https://github.com/pryrt/Win32-Mechanize-NotepadPlusPlus/issues, or by emailing <bug-Win32-Mechanize-NotepadPlusPlus AT rt.cpan.org> or thru the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32-Mechanize-NotepadPlusPlus.

COPYRIGHT

Copyright (C) 2019,2020 Peter C. Jones

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.


VERSION HISTORY

2020 Mar 21: v0.002 released to CPAN

  • Reorganize the hash variables for easier and clearer use going forward (#13)
  • editor->getLine() on an empty line will now correctly return an empty string, not "\0" (fixed #14)
  • update API for getNumberOpenFiles to correctly use the constants (#17)
  • add notepad->getNppVar() for accessing the "user variables", like FULL_CURRENT_PATH and CURRENT_WORD (#19)
  • improve documentation internal links (#20)
  • make the editor->hwnd() a public method (instead of using editor()->{_hwnd})
  • make the notepad->hwnd() a public method (instead of using notepad()->{_hwnd})
  • add helper editor->getEOLString(): convert EOL Mode integer to a string
  • editor->getFileEndPosition(): gives the end position of the whole document
  • improve test coverage: add encoding names and getLanguageName coverage to npp-buffer.t
  • examples/ folder: adding more example usages
  • improve Editor documentation on ->findText and some other methods, and clean up set/get pairs, so they share the same information
  • improve Notepad documentation, especially fixing the link for menuCmdID source file


2020 Apr 6: v0.003 released to CPAN

The user-centric changes that were made:

  • some of the Scintilla v4.2.0 messages that were implemented in Notepad++ v7.8 were missing, so add them (#29: thanks VinsWorldcom for pointing this out!)
  • runPluginsCommand() = fixed command cache feature and improved test (#30)
  • added version notes, to say which messages and "enums" (hashes/keys) require NPP v7.8 (because these are the Scintilla v4.2.0 updates)

In reply to Announcing Perl-based automation of Notepad++ by pryrt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found