Re: Count of Tab characters
Re: Count of Tab characters
- Subject: Re: Count of Tab characters
- From: Emmett Gray <email@hidden>
- Date: Wed, 24 Jan 2001 07:30:27 -0500
I'm coming late to this discussion, but why can't you just:
tell application "Microsoft Word"
activate
do Visual Basic " Selection.WholeStory"
copy
end tell
set wordText to the clipboard
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to tab
set countTabs to (count text items of wordText) - 1
set AppleScript's text item delimiters to oldDelims
countTabs
--Emmett
On Wed, 24 Jan 2001 16:57:51 +1300, David Wignall <email@hidden> wrote:
on 24/1/01 5:09 AM, Bill Planey at email@hidden wrote:
Where does one get MacPerl, and what is it?
-- 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