in

Quark Forums



This is a user-to-user forum, where you can meet community experts, exchange ideas
and discuss solutions with other users of QuarkXPress, App Studio and other products.
You'll also find employees of Quark Software Inc. participating in discussions.

If you are looking for official support or need immediate help please go to http://quark.parature.com/

Alphabetic text sorting

Last post 05-31-2011 12:55 PM by William Bragg. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 10-11-2007 8:54 AM

    Alphabetic text sorting

    Does anyone know if it is possible to sort a list of imported text in quark 7 alphabetically?
  • 10-11-2007 9:27 AM In reply to

    • kjeld
    • Top 75 Contributor
    • Joined on 08-08-2004
    • Amsterdam
    • Posts 151

    Alphabetic text sorting

    Can’t find a sort-function, but this works very well:

    1. Make a new stylesheet (TextToSort) for the text you want to sort.
    2. Make a new stylesheet for the this text after sorting (TextSorted)

    These stylesheets can have the same specifications of course.

    3. Go to Edit / Lists / Make new list
    4. Make a new list from the stylesheet TextToSort, text only, format as TextSorted).
    5. Go to window / Show lists
    6. Select the text you want to sort and click update in the list window.
    7. Keep your text selected, then click build.

    It now sorts your text and changes the stylesheet. When you click update again in the list window, you will see there is no text anymore. For every following list in your document you can do the same.
    Remember you need to make the stylesheet TextSorted, otherwise it will create sorted lists of all the text in your document with the stylesheet TextToSort.
    OS 10.6.8 / QXP 8.15
    Filed under:
  • 10-11-2007 10:12 AM In reply to

    Alphabetic text sorting

    This is a cool trick as long the text is freshly imported with no specific Style Sheets applied to the paragraphs or words. (In my case I sometimes need to sort paragraphs that are bibliography with local formatting applied. I can't seem to sort strings keeping that formatting.)
    Another trick would be using an AppleScript provided you are working on a Mac. (I have compiled such a script but again I can't seem to retain formatting.)
    Jean-Marie Schwartz

    > Mac Pro Quad Core Intel 2.8 GHz, OS X.8.5, Quark XPress 9.5.4, Adobe CS5 <
  • 10-11-2007 1:56 PM In reply to

    Alphabetic text sorting

    Don't know if this will help or not as it's for v6.x:

    http://www.durrant.co.uk/sorttextm.html
    Erik Youngren | Mac Pro 2.8Ghz Quad-Core Intel Xeon | InDesign CS4 | Suitcase Fusion 5
    erik@quarktronic.com
    Quark Forums member since 2001
  • 10-16-2007 10:43 AM In reply to

    Alphabetic text sorting

    Jean-Marie,

    Is there any way I could get a copy of the script that you wrote?

    Please. I'm running quark 7.3 on a mac pro.
  • 10-16-2007 10:45 AM In reply to

    Alphabetic text sorting

    Eyoungren,

    Thanks, tried the extension but it is not compatable with version 7.
  • 10-16-2007 10:48 AM In reply to

    Alphabetic text sorting

    kjeld,

    Thanks for your reply, I have not had a chance to try this solution yet, but looks to be a suitable workaround for the moment.
  • 10-16-2007 1:32 PM In reply to

    Alphabetic text sorting

    PrepressPaul:
    Jean-Marie,

    Is there any way I could get a copy of the script that you wrote?

    Please. I'm running quark 7.3 on a mac pro.


    Sure! Or even better, here is the code. It's a mixture of Apple's apple script plus Tim Conner's hand and finally my adaptation to Quark - which was the easiest part of it all :lol:
    Select the paragraphs you want to sort prior to run the script.
    Hope it's OK with you.
    [quote user=olive:986246db26] This script will convert anything in the finder to text, and then sort that text. Procedure is to copy an item. Run this script from the script menu, then paste. (Original Script by Tim Conner. Adaptation to QuarkXPress by Jean-Marie Schwartz :-) )[/color:986246db26][/i]
    *)
    tell application "QuarkXPress Passport"
         activate
         select menu item "Copy" of menu "Edition"
    end tell


    set the clipboard to list_to_string(ASCII_Sort(string_to_listclass ktxt» of ((the clipboard as text) as record), return)), return)

    tell application "QuarkXPress Passport"
         activate
         select menu item "Paste" of menu "Edition"
    end tell


    on ASCII_Sort(my_list)
         --from apple
         set the index_list to {}
         set the sorted_list to {}
         repeat (the number of items in my_list) times
              set the low_item to ""
              repeat with i from 1 to (number of items in my_list)
                   if i is not in the index_list then
                        set this_item to item i of my_list as text
                        if the low_item is "" then
                             set the low_item to this_item
                             set the low_item_index to i
                        else if this_item comes before the low_item then
                             set the low_item to this_item
                             set the low_item_index to i
                        end if
                   end if
              end repeat
              set the end of sorted_list to the low_item
              set the end of the index_list to the low_item_index
         end repeat
         return the sorted_list
    end ASCII_Sort


    on snr(the_string, search_string, replace_string)
         return my list_to_string((my list_to_string(the_string, search_string)), replace_string)
    end snr

    on list_to_string(the_list, the_delim)
         my atid(the_delim)
         set the_string to (every text item of the_list) as string
         my atid("")
         return the_string
    end list_to_string

    on string_to_list(the_string, the_delim)
         my atid(the_delim)
         set the_list to (every text item of the_string) as list
         my atid("")
         return the_list
    end string_to_list

    on atid(the_delim)
         set AppleScript's text item delimiters to the_delim
    end atid
    Jean-Marie Schwartz

    > Mac Pro Quad Core Intel 2.8 GHz, OS X.8.5, Quark XPress 9.5.4, Adobe CS5 <
  • 10-16-2007 2:12 PM In reply to

    Alphabetic text sorting

    Thanks Jean-Marie, this is going to come in very handy.

    :lol: Paul
  • 11-20-2008 11:34 PM In reply to

    • LTD
    • Top 75 Contributor
    • Joined on 09-25-2007
    • Sydney, Australia
    • Posts 163

    Re: Alphabetic text sorting

    http://www.durrant.co.uk/Sort%20Text%201.4.1%20Mac.zip

    Works with v7 and retains all local formatting.

  • 11-30-2008 6:02 PM In reply to

    Re: Alphabetic text sorting

    Thanks for the tip! That's what I was looking for! This allows me to take on a big project for a publishing client!

  • 05-31-2011 12:55 PM In reply to

    Re: Alphabetic text sorting

    In XPress 8.5, I select the text and save text as a Microsoft Word document. Open it in Word and use the sort text command. Then import the text back into XPress. All local styling should remain.
Page 1 of 1 (12 items)
Powered by Community Server (Commercial Edition), by Telligent Systems