Re: Count of Tab characters
Re: Count of Tab characters
- Subject: Re: Count of Tab characters
- From: Bill Planey <email@hidden>
- Date: Tue, 23 Jan 2001 10:09:53 -0600
Where does one get MacPerl, and what is it?
Thanks,
Bill Planey
>
-- 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
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
Bill Planey
3311 Oak Lawn Ave., Suite 300
Dallas, TX 75219 USA
email@hidden
214-528-5990 voice
214-521-8536 fax
214-557-2655 mobile