• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: scripting bbedit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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]


  • Follow-Ups:
    • Re: scripting bbedit
      • From: Jan Erik Moström <email@hidden>
  • Prev by Date: [OT] Re: Questions about archiving email
  • Next by Date: Re: Deleting files/folders
  • Previous by thread: Error -8850 & duplicatecoreobj obj
  • Next by thread: Re: scripting bbedit
  • Index(es):
    • Date
    • Thread