• 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
Scripting text edit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting text edit


  • Subject: Scripting text edit
  • From: andrew <email@hidden>
  • Date: Fri, 10 Jun 2005 16:00:31 -0400

Title: Scripting text edit
I have a simple script that is intended to take an RTF file (exported from Mail) and strip put all the “quoted” replies.

When exporting from mail it seems any threaded replies are given a different color. Thus on its face it seems a simple applescript loop to look at each paragraph and delete it if the color is not black is the perfect solution.

However it seems to be agonizing slow to perform this very simple task. Further the slowness to progressive. After each “deletion” the program get slower and slower.

Anyone care to comment on what the heck the problem is here ? I have tried running from both script editor and as an appplescript applet with no change.

Thanks

Andrew


Script follows

tell application "TextEdit"
    
activate
   set y to 1
   set x to the count of paragraphs of the first document
   repeat until y = x
       set test_var to properties of paragraph y of document 1
       if the color of test_var ≠ {0, 0, 0} then
           
delete paragraph y of document 1
           --display dialog " delete #" & y
           set y to y + 1
       else
           --
display dialog " NOOO delete #" & y
           set y to y + 1
       end if
   end repeat
end
tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: set zoomed fails in Tiger Cc:
  • Next by Date: Script Objects - help please!!
  • Previous by thread: Re: set zoomed fails in Tiger Cc:
  • Next by thread: Re: Scripting text edit
  • Index(es):
    • Date
    • Thread