Re: scripting bbedit
Re: scripting bbedit
- Subject: Re: scripting bbedit
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 27 Jun 2001 02:46:59 -0400
- Organization: [very little]
>
Date: Tue, 26 Jun 2001 16:30:59 -0400
>
Subject: scripting bbedit
>
To: email@hidden
>
From: "Arthur Cormack" <email@hidden>
>
>
Greetings and Salutations, appleScript JourneyMen, and journeyWomen.
>
>
Quick question:
>
>
What is the smartest way to search a big text file an occurance of
>
specific word and return the number of the line that that word occurs
>
on?
>
Is BBEdit the tool to use? Does anyone know if there is a command in
>
BBEdit's scripting commands that would return this line number?
I don't know how it works in BBEdit, but it's very easy to do in
Tex-Edit Plus:
tell application "Tex-Edit Plus"
open (choose file of type {"TEXT"})
set sStrng to text returned of (display dialog "Search " & [optn-L]
"String?" default answer "")
set bFnd to (search window 1 looking for sStrng)
if bFnd then
display dialog (line offset of the selection) as text
else
display dialog "It wasn't there!"
end if
end tell
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[6/27/01 2:44:50 AM]