You are here: PSPad forum > English discussion forum > Re: PSPad 5.x: How to do about 12 search and replaces on the open tab?
Posted by: therium | Date: 2018-09-09 13:31 | IP: IP Logged
- PSPad 5.0.0
- Windows 8 (my home PC)
I convert historical documents from PDF to text, and then to Markdown, then to EPUB. In order to make the files neat I want to do about a dozen search and replaces on every file, namely, the open tab. I want to write a script to do this in PSPad in VBScript. I found one at www.phdesign.com.au but the site is no longer there.
Can someone help me out and show me a 2 line script to do 2 search and replaces on the current tab in PSPad? I want to search and replace all lines in the open tab. I'm a Perl programmer but have not done VBscript before. So the regex between Perl and VBScript might have some differences. I have Script support enabled in PSPad and have the Scripts menu showing, and made a file under PSPad\Scripts\VBScript\cleanup.vbs, but even after restarting PSPad the script is not on my PSPad scripts menu.
Can we start with getting the script to appear on the Scripts menu? I assume that's how it works: the scripts appear on the Scripts menu and I click on the menu item to run that script on the current PSPad tab.
- I don't know if I have WSH installed on my PC but the Scripts menu appears on PSPad. Is this setup properly?
- Do .vbs files have to be associated with VBScript at the OS level? I used PSPad to associate .vbs files with PSPad to edit them already.
Thank you!
Posted by: pspad | Date: 2018-09-09 13:42 | IP: IP Logged
Hello
Look at user convertors. In the PSPad 5 you can use regular expression in user convertors as well.
User convertor definition is list of search/replace strings what are applied to open tab
Posted by: therium | Date: 2018-09-09 23:13 | IP: IP Logged
Ok, I found the user convertors. I'm trying to remove a 2 byte character which is a diamond. The decimal value is 9830, hex value x2666. I put 9830 under the [Remove chars] section of my own Convertors\chuck.ini file, selected the text with the diamond character and ran my convertor but the diamond was not removed.
How do I remove 2 byte characters?
Posted by: therium | Date: 2018-09-09 23:15 | IP: IP Logged
Here I will copy and paste the line with the diamond character at the very beginning of the line. I don't know if it will turn out correct.
♦2398-PS
You can use this for testing.
Posted by: pspad | Date: 2018-09-10 03:51 | IP: IP Logged
Don't use byte replace, but use string replace
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR