• 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: Count of Tab characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Count of Tab characters


  • Subject: Re: Count of Tab characters
  • From: g3pb <email@hidden>
  • Date: Mon, 22 Jan 2001 20:05:55 -0900

-- mixing in a little MacPerl will help the speed

tell application "Microsoft Word"
activate
do Visual Basic " Selection.WholeStory"
copy
end tell
set wordText to the clipboard
tell application "MacPerl"
Do Script ["
$count = ($ARGV[0] =~ tr/ //);
MacPerl::Reply($count);
", wordText]
end tell
set countTabs to result

-- hcir
mailto:email@hidden


> This proves surprisingly slow, 25 seconds to do a 48 page/944 tabs document
> OMM, including trying to speed things up by turning screen updating off.
>
> tell application "Microsoft Word"
> do Visual Basic "Application.ScreenUpdating = False
> theNumber = 0
> With Selection.Find
> .Text =\"^t\"
> .Wrap = wdFindStop
> Do While .Execute = True
> theNumber = theNumber + 1
> Loop
> End With
> Application.ScreenUpdating = True
> MsgBox theNumber & \" tabs in this document\""
> end tell


References: 
 >Re: Count of Tab characters (From: David Wignall <email@hidden>)

  • Prev by Date: Re: [ANN] Report on AS 1.5.5 from AppleScript Sourcebook
  • Next by Date: Display Updating ??
  • Previous by thread: Re: Count of Tab characters
  • Next by thread: Re: Count of Tab characters
  • Index(es):
    • Date
    • Thread