4

image Calling Visual Basic from UNIX

If we can call Visual Basic from AppleScript and we can call AppleScript from the UNIX shell, then chaining the two together allows us to call Visual Basic from the UNIX shell. Like this:

echo “tell application \"Microsoft Word\""          >> myScript.txt echo “do Visual Basic \"Selection.Find.ClearFormatting\"" >> myScript.txt    <… set up the rest of the find parameters …> echo “do Visual Basic \"Selection.Find.Execute\""      >> myScript.txt echo “end tell"                           >> myScript.txt osascript myScript.txt

You could drive Excel, PowerPoint, or any other scriptable component of the Office suite ...

Get Developing Quality Metadata now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.