Re: scripting bbedit
Re: scripting bbedit
- Subject: Re: scripting bbedit
- From: Christian Smith <email@hidden>
- Date: Wed, 27 Jun 2001 08:22:50 -0400
"Arthur Cormack" <email@hidden> wrote:
>
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?
BBEdit is certainly one of the tools one can use for this.
>
Does anyone know if there is a command in BBEdit's scripting commands that
>
would return this line number?
The "find" command returns what you need. Here is a sample script:
tell application "BBEdit 6.1"
set s_results to find "BBEdit" searching in text of window 1
if found of s_results then
get startLine of found object of s_results
end if
end tell
--
Christian Smith | email@hidden |
http://web.barebones.com
PGP Fingerprint - 60E5 2216 97D2 1D1A B923 F036 00A9 CEC0 D411 FA89