DONE: Menu / Keyboard / Macro / Script Commands

Report issues, odd behaviors or submit a detailed bug report.
Post Reply
crtrubshaw
Posts: 349
Joined: 06 Jun 2012 11:08

DONE: Menu / Keyboard / Macro / Script Commands

Post 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.
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: Menu / Keyboard / Macro / Script Commands

Post 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.
crtrubshaw
Posts: 349
Joined: 06 Jun 2012 11:08

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

Post by crtrubshaw »

Thank you very much :-D
crtrubshaw
Posts: 349
Joined: 06 Jun 2012 11:08

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

Post 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.
Post Reply