• 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
Scripting MSWord
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scripting MSWord


  • Subject: Scripting MSWord
  • From: "Joseph A. Weaks" <email@hidden>
  • Date: Sun, 7 Oct 2001 23:30:01 -0500

I have been writing some simple Applescripts for several text editors,
but when I write them for Word 98 on my G3 running 8.6, they run like
molasses. The scripts are simple, do visual basic find a pattern, copy
that pattern into a variable, activate my app that returns a new
variable, paste that variable into Word. But every VB line of this
code is so slow....and eventually crashes. Any ideas?

tell application "Microsoft Word"
activate
do Visual Basic " Selection.Find.ClearFormatting"
do Visual Basic " With Selection.Find
.Text = \"<[1-4a-zA-Z.]@[a-zA-Z .][0-9]{1,3}[:][0-9 \\-:.,f]{1,}\"
.Replacement.Text = \"\"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With"
do Visual Basic " Selection.Find.Execute"
set theResults to (contents of selection)

do Visual Basic " Selection.MoveRight Unit:=wdCharacter, Count:=1"
set contents of selection to "
"
end tell
-- Go do do stuff with that variable, then return to Word to paste it in.

tell application "Microsoft Word"
activate
set contents of selection to theResults
set contents of selection to "
"
end tell


Thanks for any help,
Joe Weaks
--
* * * * * * * * * * * * * * * * * * * * *
Joe Weaks
A Bible, Greek, Mac, and Scripting Nut
* * * * * * * * * * * * * * * * * * * * *


References: 
 >THANK YOU! Re: File name list help? (From: "T.J. Mahaffey" <email@hidden>)

  • Prev by Date: Re: Internet Explorer file extension
  • Next by Date: Re: Scripting Palm Desktop --- syntax to modify Custom fields
  • Previous by thread: THANK YOU! Re: File name list help?
  • Next by thread: Re: THANK YOU! Re: File name list help?
  • Index(es):
    • Date
    • Thread