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 tellset the clipboard to list_to_string(
ASCII_Sort(
string_to_list(«
class ktxt»
of ((
the clipboard as text)
as record),
return)),
return)
tell application "QuarkXPress Passport"
activate select menu item "Paste"
of menu "Edition"
end tellon 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_listend ASCII_Sorton snr(
the_string,
search_string,
replace_string)
return my list_to_string((
my list_to_string(
the_string,
search_string)),
replace_string)
end snron 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_stringend list_to_stringon 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_listend string_to_liston atid(
the_delim)
set AppleScript's
text item delimiters to the_delimend atid