DONE: Menu / Keyboard / Macro / Script Commands
Posted: 18 Feb 2025 13:47
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.
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.