Re: sorting html text with arrays

2010-10-06 Thread Jim Ault

Use the form

sort myContainer by mySortFuction(each, myContainer)
-- specify text, numeric, ascending, descending

function mySortFunction singleLineOfList, wholeList
   --apply as many rules as you wish
   --filter as many times as you wish
   --build as many arrays or tables as you wish
   return (a value to sort by)
end mySortFunction


Jim Ault
Las Vegas

On Oct 5, 2010, at 8:46 PM, Mark Swindell wrote:

Excellent question, and one I only thought of after posting mine!   
There would need to be a series of precedence rules, and I don't  
know them.


But to simplify, let's say you had unique examples of styled tex,  
and t that you wanted to maintain their styles.  For example, in  
this mini-dictionary I've got 26 (almost) unique headings:  A B C  
D... etc. bold, larger font, underlined.  I want them to maintain  
their integrity while adding in a batch of new words.  Would it be  
possible to sort while leaving alone the htmlText characteristics of  
first instance items in a field such as this?


Mark


On Oct 5, 2010, at 4:09 PM, Dick Kriesel wrote:

Hi, Mark.  What are the rules for handling words that appear with  
more than

one style?

-- Dick 



On 10/5/10 11:40 AM, "Mark Swindell"  wrote:

I'm using the following script to create a glossary/word list of  
all words
appearing in a songbook I'm making in Apple's Pages word processor  
(over 2,000

unique words).   (Thanks to Phil Davis for his help with arrays.)

What I am wondering is if the formatted text can be retained in a  
case like
this, and how.  My attempts so far have failed, as the htmlText  
tags are
included in the sort... not what I want.)  I'd like to be able to  
paste in
from the word processor and do the sort while maintaining  
formatting (bold,
font, font size), and then be able to take that result and copy  
and paste it

back into the word processor.

Am I asking too much?

Thanks
Mark

on mouseUp
 repeat for each word tWord in tStripEm
  add 1 to aWordCounts[tWord]
 end repeat
 put the keys of aWordCounts into tList
 sort lines of tList
 put tList into field "sorted3"
end mouseUp___








___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sorting html text with arrays

2010-10-05 Thread Mark Swindell
Excellent question, and one I only thought of after posting mine!  There would 
need to be a series of precedence rules, and I don't know them.  

But to simplify, let's say you had unique examples of styled tex, and t that 
you wanted to maintain their styles.  For example, in this mini-dictionary I've 
got 26 (almost) unique headings:  A B C D... etc. bold, larger font, 
underlined.  I want them to maintain their integrity while adding in a batch of 
new words.  Would it be possible to sort while leaving alone the htmlText 
characteristics of first instance items in a field such as this?

Mark


On Oct 5, 2010, at 4:09 PM, Dick Kriesel wrote:

> Hi, Mark.  What are the rules for handling words that appear with more than
> one style?
> 
> -- Dick 
> 
> 
> On 10/5/10 11:40 AM, "Mark Swindell"  wrote:
> 
>> I'm using the following script to create a glossary/word list of all words
>> appearing in a songbook I'm making in Apple's Pages word processor (over 
>> 2,000
>> unique words).   (Thanks to Phil Davis for his help with arrays.)
>> 
>> What I am wondering is if the formatted text can be retained in a case like
>> this, and how.  My attempts so far have failed, as the htmlText tags are
>> included in the sort... not what I want.)  I'd like to be able to paste in
>> from the word processor and do the sort while maintaining formatting (bold,
>> font, font size), and then be able to take that result and copy and paste it
>> back into the word processor.
>> 
>> Am I asking too much?
>> 
>> Thanks
>> Mark
>> 
>> on mouseUp
>>   repeat for each word tWord in tStripEm
>>add 1 to aWordCounts[tWord]
>>   end repeat
>>   put the keys of aWordCounts into tList
>>   sort lines of tList
>>   put tList into field "sorted3"
>> end mouseUp___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sorting html text with arrays

2010-10-05 Thread Dick Kriesel
Hi, Mark.  What are the rules for handling words that appear with more than
one style?

-- Dick 


On 10/5/10 11:40 AM, "Mark Swindell"  wrote:

> I'm using the following script to create a glossary/word list of all words
> appearing in a songbook I'm making in Apple's Pages word processor (over 2,000
> unique words).   (Thanks to Phil Davis for his help with arrays.)
> 
> What I am wondering is if the formatted text can be retained in a case like
> this, and how.  My attempts so far have failed, as the htmlText tags are
> included in the sort... not what I want.)  I'd like to be able to paste in
> from the word processor and do the sort while maintaining formatting (bold,
> font, font size), and then be able to take that result and copy and paste it
> back into the word processor.
> 
> Am I asking too much?
> 
> Thanks
> Mark
> 
> on mouseUp
>repeat for each word tWord in tStripEm
> add 1 to aWordCounts[tWord]
>end repeat
>put the keys of aWordCounts into tList
>sort lines of tList
>put tList into field "sorted3"
> end mouseUp___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sorting html text with arrays

2010-10-05 Thread Jim Ault

This can be done depending on the text of each line.
Can you provide examples of the lines you want to sort?


On Oct 5, 2010, at 11:40 AM, Mark Swindell wrote:

I'm using the following script to create a glossary/word list of all  
words appearing in a songbook I'm making in Apple's Pages word  
processor (over 2,000 unique words).   (Thanks to Phil Davis for his  
help with arrays.)


What I am wondering is if the formatted text can be retained in a  
case like this, and how.  My attempts so far have failed, as the  
htmlText tags are included in the sort... not what I want.)  I'd  
like to be able to paste in from the word processor and do the sort  
while maintaining formatting (bold, font, font size), and then be  
able to take that result and copy and paste it back into the word  
processor.


Am I asking too much?

Thanks
Mark

on mouseUp
  repeat for each word tWord in tStripEm
   add 1 to aWordCounts[tWord]
  end repeat
  put the keys of aWordCounts into tList
  sort lines of tList
  put tList into field "sorted3"
end mouseUp


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: sorting html text with arrays

2010-10-05 Thread Ray Horsley
Mark,

Are you familiar with setting the htmlText of a field?  (I've posted a few
questions to this list myself recently regarding various aspects of this
feature.)  You might try making an entire card for each word, set the
htmlText of a field in it to your html, sorting the cards by some
criteria-perhaps another field with other data in it, and then getting the
htmlText of each field in the new order of the cards.

Hope this helps,

Ray

-Original Message-
From: use-revolution-boun...@lists.runrev.com
[mailto:use-revolution-boun...@lists.runrev.com] On Behalf Of Mark Swindell
Sent: Tuesday, October 05, 2010 2:41 PM
To: How to use Revolution
Subject: sorting html text with arrays

I'm using the following script to create a glossary/word list of all words
appearing in a songbook I'm making in Apple's Pages word processor (over
2,000 unique words).   (Thanks to Phil Davis for his help with arrays.)  

What I am wondering is if the formatted text can be retained in a case like
this, and how.  My attempts so far have failed, as the htmlText tags are
included in the sort... not what I want.)  I'd like to be able to paste in
from the word processor and do the sort while maintaining formatting (bold,
font, font size), and then be able to take that result and copy and paste it
back into the word processor.

Am I asking too much?

Thanks
Mark

on mouseUp
   repeat for each word tWord in tStripEm
add 1 to aWordCounts[tWord]
   end repeat
   put the keys of aWordCounts into tList
   sort lines of tList
   put tList into field "sorted3"
end mouseUp___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution