Page 1 of 1

DONE: Menu / Keyboard / Macro / Script Commands

Posted: 18 Feb 2025 13:47
by crtrubshaw
Hi Rickard, it seems the commands in the app aren't consistent depending how you use it. For example, what is available in the menus/keyboard commands aren't the same as what's available in the Macro Editor or within script (objects like MainApp, Document & ScriptUtils). Case in point I was trying to write something to do the following...

1. Trim all whitespace from all lines (script: ScriptUtils.RegExReplaceAll)
2. Delete all blank lines (macro: cmdDeleteBlankLines /script: Document.DeleteBlankLines)
3. Sort ascending - no "sort unique"? (macro: cmdSortAsc / script: MainApp.Sort_Ascending)
4. Delete duplicate lines - no "sort unique" as above (macro: cmdDeleteDuplicateLines)

In this case specifically, I see a few possible fixes...

- Create a function to trim lines (leading and trailing white space) - make it availble in menu/keyboard/macro\script as well.
- Add sort functions in macro/script to sort unique.
- Make "DeleteDuplicateLines" available in script (I like this because it's a separate function, not tied up with sort).

What do you think about implementing one or more of these suggestions?

Thank you.

Re: Menu / Keyboard / Macro / Script Commands

Posted: 05 Mar 2025 19:09
by Rickard Johansson
Added 2 new menu items to sort unique asc/desc.

Added sort unique and trim trailing spaces to macros and as functions in scripts (MainApp object).

Done in v16.38.

Re: DONE: Menu / Keyboard / Macro / Script Commands

Posted: 06 Mar 2025 19:44
by crtrubshaw
Thank you very much :-D

Re: DONE: Menu / Keyboard / Macro / Script Commands

Posted: 13 Mar 2025 11:59
by crtrubshaw
Just a note on this, can you make a function to trim all white space (leading AND trailing), or separate function for trim leading? Will be useful for sort unique.

Thank you.