Subject: Re: Applescripting "process lines containing"
Posted: 2008-05-08 19:29:58
Author: Isaac Wingfield
First Message | Previous Message | Next Message | Last Message
On May 8, 2008, at 2:03 AM, TextWrangler-Talk List wrote:
>
> From: Tom Robinson <barefootguru@[Protected]>
> Date: May 7, 2008 5:08:55 PM PDT
> Subject: Re: Applescripting "process lines containing"
>
>
> On 2008-05-08, at 10:51, Isaac Wingfield wrote:
>
>> I need an AppleScript that finds certain text "killthisline", and
>> then deletes the entire line containing that string.
>>
>> I have tried a *lot* of combinations, but I cannot figure out the
>> syntax necessary to make AppleScript and TextWrangler do that.
>
> The Record button in Script Editor is your friend. Removing a
> 'try' so you can see errors is always helpful too.
>
> tell application id "com.barebones.textwrangler"
> process lines containing text 1 of text document 1 matching string
> "killthisline" output options {deleting matched lines:true}
> end tell
I've written AppleScripts off and on (mostly off) ever since it came
out, but I still tend to forget that button.
Thanks.
isw