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.
DONE: Menu / Keyboard / Macro / Script Commands
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Menu / Keyboard / Macro / Script Commands
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.
Added sort unique and trim trailing spaces to macros and as functions in scripts (MainApp object).
Done in v16.38.
-
- Posts: 349
- Joined: 06 Jun 2012 11:08
Re: DONE: Menu / Keyboard / Macro / Script Commands
Thank you very much 

-
- Posts: 349
- Joined: 06 Jun 2012 11:08
Re: DONE: Menu / Keyboard / Macro / Script Commands
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.
Thank you.