Page 1 of 1

sorting tables in Hebrew with NWE

Posted: 2007-01-09 02:51:32
by Rivka
Sorry if this has already been answered, but I can't find the question (nor the answer).

I have created a 2 columns table, but can't sort it - all I could see in the manual is "sort paragraph", and this isn't what I need. How do I sort the information within a table (in Hebrew) while keeping the corresponding items one in front of the other ?

Tks in advance,

Rivka :? :?

Posted: 2007-01-11 13:17:25
by ssampler
It is not possible to sort within table cells in English either. What you can do is select the text you wish to sort within each cell. copy the text elsewhere, sort it using "Sort Paragraphs", and paste it back into the cell.

You can automate this process a bit by creating the following Menu Macro and putting it in the Macro folder, accessible from the Macro Menu. Call the macro something like “Sort Clipboard". Save it as a Nisus Macro; Nisus will add an "nwm" extension.

The macro consists of six lines in English:

Edit Current Clipboard
Select All
Ascending (A-Z)
Select All

To use the macro.
1. Select the table cell you want to sort
2. Run the macro from the macro menu.
3. Switch back to the original document (the cell-text will still be selected)
4. Type CMD-V (Paste)

I haven't tried this in Hebrew, but it works in English.


Posted: 2007-01-12 02:16:34
by Rivka
tks - quite labroious... PIty they don't have sort table like in Microsotf word, but I guess this will come, too, eventually


Posted: 2007-01-12 06:38:43
by ssampler
To make this a two-step process, I created the following Apple Script. . For each table cell: 1. Select text; 2. Run the script. If you keep the script open in Script Editor, you can just hit the Run button.

I'm sure the script can be improved. There is at least one problem: After the script is run, the cursor places itself on the line following the selection and, if necessary adds a return to do this. The result is a new line, whch can be removed by hitting the delete key.


Script Follows after next line:
Sort & Replace Selected Text
Note: If there is no return at the end of the selected text, one is added.
tell application "Nisus Writer Express"
set frontDoc to document 1
Do Menu Macro with macro "Edit:Copy:Copy"
Do Menu Macro with macro "Edit:Clipboards:Edit Current Clipboard"
Do Menu Macro with macro "Edit:Select All"
Do Menu Macro with macro "Edit:Sort Paragraphs:Ascending (A-Z)"
Do Menu Macro with macro "File:Close"
get frontDoc
Do Menu Macro with macro "Edit:Paste"
end tell