Trying to set up a macro for EmEditor to execute the following steps that I could otherwise do manually.
- open file
- view > large file controller
- set To=1000
- Click Apply
- Click Save Opened Portion As...
- Enter TestMacro and Save
I'm using: EmEditor Professional (64-bit) version 22.4.1. Windows 10 operating system.
I tried recording, that didnt seem to work.
Then I tried variations of this snippet suggested as answer but error provided was specificed file does not exist.
editor.WriteProfileInt( eeRegCommon, "", "DefaultBytesTo", 1000 ); // open to 1000 bytes
editor.RefreshCommonSettings();
editor.OpenFile( "D:\\Test\\Input.txt", 0, eeOpenDetectUnicode | eeOpenDetectUTF8 );
editor.WriteProfileInt( eeRegCommon, "", "DefaultBytesTo", 0 ); // open to unlimited
editor.RefreshCommonSettings();
editor.ExecuteCommandByID(4323); // Clear All Bookmarks in This Document
editor.ExecuteCommandByID(4588); // Invert Bookmarks in This Document
editor.ExecuteCommandByID(4590); // Extract Bookmarked Lines in This Document to New File
document.Save( "D:\\Test\\TestMacro.txt" );
How is this macro set up to achieve these steps?
After editing my file path to "input" instead of "input.txt" error was resolved.