Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Announcing Perl-based automation of Notepad++

by pryrt (Prior)
on Feb 22, 2020 at 19:35 UTC ( #11113336=CUFP: print w/replies, xml ) Need Help??

At long last, I have a version of my Perl module for automating Notepad++ (the Windows-based text editor) that Iíve been willing to publish.


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.

Replies are listed 'Best First'.
Re: Announcing Perl-based automation of Notepad++
by Anonymous Monk on Feb 25, 2020 at 03:37 UTC

    Hi,

    So what is the use case?

      So what is the use case?

      Replacing the PythonScript plugin with a real programming language. ;-)

      Notepad++ has some excellent features -- it's got a Boost regex engine, and a simple macro language. However, there are cases when those tools aren't quite sufficient for the task at hand: often, those include things when you need loops (perform the same set of actions many times), or when the search term and/or replacement sequence should be algorithmically generated: in the Notepad++ Community forum, we often see requests for "how to I replace all of these matching numbers with 1 plus the number" or "how do I replace these with a random number or random string" or similar tasks. You cannot do those in the standard Boost-based search-and-replace dialog, but could easily be done in Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://11113336]
Front-paged by Discipulus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-03-31 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (185 votes). Check out past polls.

    Notices?