I know how to sort a table in Frame Maker but I need ESTK script to sort a table.
I am creating a macro for one of my application using ESTK script. In that script, I want to sort a table, for that I need ESTK script to sort the table.
Here is how you can sort a table with ExtendScript:
#target framemaker var doc = app.ActiveDoc; // Set a variable for the selected table. var tbl = doc.SelectedTbl; // Select the table. tbl.MakeTblSelection (Constants.FF_SELECT_WHOLE_TABLE); // Sort the table. CallClient ("TableSort", "row nocase 0 ascending -1 ascending -1 ascending");
Here is information from the FDK Programmers Reference for the TableSort parameters:
Thank you very much for your response.
your code is working fine only when you have the curser inside the table.
If I put the curser outside the table, it gives a alert message "? No table has been selected. Please select a table and try again."
Please guide me how can resolve this .
Instead of using doc.SelectedTbl you need to find your target table via the list of tables in your document. Start with doc.FirstTblInDoc and walk through the linked list until you find the table to sort. Then execute the sort code on it.
Thanks a lot for your information. Its Working...