• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: processing time & stack overflow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: processing time & stack overflow


  • Subject: Re: processing time & stack overflow
  • From: monk <email@hidden>
  • Date: Wed, 29 Aug 2001 05:14:53 -0400

-- 8/28/01 6:26 PM: email@hidden said:

> On Tue, 28 Aug 2001 11:05:04 -0400, Arthur J Knapp wrote,
>
>> on NewOrder(lst)
>> set {s1, s2, len} to ,
>> {random number from 1 to 100000, 31415, lst's length}
>> repeat with i from 1 to len
>> set {j, s1} to {(s1 mod len) + 1, (s1 * s2) mod len}
>> set {lst's item i, lst's item j} to ,
>> {lst's item j, lst's item i}
>> end repeat
>> end NewOrder
>
> Thanks Arthur :)
>
> After playing with this 'cross cutting' script for a while, I would have to
> conclude that having AppleScript very large lists isn't a good idea. In this
> case, it seems best to use it for what it's meant to be used for; as a means
> to make decisions and tell other applications to do the work.
>
that is the conclusion i'm begining to come to -

with 'some' i think that when i originally tried this i was able to return
the correct amount of items from the original file, but i could not screen
them, and thus lots of the same item repeating until the item count was
complete, and lots of missed items

i'll have to download texedit plus and try, or adapt this to bbedit maybe?

all the best


h

> Here's a script that uses Tex-Edit Plus that seems to scale well, although,
> perhaps not as fast as you'd like.
>
> Victor
>
>
> on _switchWords(a, b)
> tell application "Tex-Edit Plus"
> tell window 1
> set x to text of word a
> set contents of word a to text of word b
> set contents of word b to x
> end tell
> end tell
> return
> end _switchWords
>
> on _saveResult(thisFile)
> tell application "Tex-Edit Plus"
> tell window 1
> save in file thisFile
> end tell
> end tell
> end _saveResult
>
> set _source to (choose file with prompt "choose source to juxtapose:")
>
> tell application "Tex-Edit Plus"
> open _source
> set _wordcount to count of words of window 1
> end tell
>
> set _fileamount to "1"
>
> repeat until class of _fileamount is integer and _fileamount > 0 and
> _fileamount < 100
> try
> display dialog "enter amount of files to generate from source (1-99)?" default
> answer _fileamount giving up after 12
> set _fileamount to text returned of the result as integer
> on error
> display dialog "that wasn't the right kind of number!"
> end try
> end repeat
>
> set _newfolder to (path to desktop as string) & "juxtatext(s)"
>
> tell application "Finder"
> --activate
> if not (exists folder _newfolder) then
> make new folder at desktop with properties {name:"juxtatext(s)"}
> end if
> open folder _newfolder
> set size of window of folder _newfolder to {253, 527}
> set view of window of folder _newfolder to kind
> end tell
>
> set _newfolder to (alias _newfolder) as string
>
> repeat with x from 1 to _fileamount
>
> repeat with a from _wordcount to 1 by -1
> set b to random number from 1 to a
> _switchWords(a, b)
> end repeat
>
> set _filename to "" & _newfolder & "juxtatext " & characters -2 thru -1 of
> ("0" & x)
> _saveResult(_filename)
>
> end repeat
> _______________________________________________
> applescript-users mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/applescript-users


  • Prev by Date: Re: processing time & stack overflow
  • Next by Date: Re: processing time & stack overflow
  • Previous by thread: Re: processing time & stack overflow
  • Next by thread: Re: processing time & stack overflow
  • Index(es):
    • Date
    • Thread