Re: Scripting textedit the revenge
Re: Scripting textedit the revenge
- Subject: Re: Scripting textedit the revenge
- From: "Nigel Garvey" <email@hidden>
- Date: Wed, 15 Jun 2005 17:34:15 +0100
andrew wrote on Wed, 15 Jun 2005 01:32:46 -0400:
>Thanks to has and others for your help with scripting textdit.
>
>However it seems perhaps the problems was not my code but rather something
>else
>
>Here what happens :I have a large RTF textedit document ( about 95000)
>lines.
>The script ( at end of this msg) runs and it starts off moving very
>quickly about 2 lines per second...after 1500 or so lines the speed is down
>to 1 line per second.
>--the Has version
>tell application "TextEdit"
> tell text of document 1
> repeat with I from (count paragraphs) to 1 by -1
> if color of paragraph I is not {0, 0, 0} then delete paragraph I
> end repeat
> end tell
>end tell
Does this version work with that amount of text?
tell application "TextEdit"
set black to {0, 0, 0}
tell text of front document
set paraColours to color of paragraphs
repeat with i from (count paraColours) to 1 by -1
if (item i of my paraColours is black) then
else
delete paragraph i
end if
end repeat
end tell
end tell
NG
_______________________________________________
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