Scripting text edit
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