WD6X: AppleScript Get Command Incorrectly Returns Hyphen

Last reviewed: November 17, 1997
Article ID: Q126371
The information in this article applies to:
  • Microsoft Word for the Macintosh, version 6.0

SYMPTOMS

When you use the AppleScript Get command to get hyphenated words from a Word document, the hyphen symbol (-) is returned as a valid word.

CAUSE

The Get command is used to retrieve objects from a Word document. The command then builds a list of those objects. For instance, when used on a document containing the words "As Time Goes By," the AppleScript code "get every word of paragraph 1" will return the list "As", "Time", "Goes", "By."

When you use the Get command to retrieve words that are separated by hyphens, the hyphen symbol is included in the list of returned items just as if it were a valid word. For example, the AppleScript code "get every word of paragraph 1" will return the list "As", "-", "Time", "-", "Goes", "-", "By" when used on a document containing the text "As-Time-Goes-By".

Microsoft Word does not have a simple method for jumping to the end of a hyphenated word; therefore, the Apple Event code does not have a simple way of returning an entire hyphenated word.


Additional query words: macword Apple script Macro word6
Keywords : kb3rdparty kb3rdparty
Version : MACINTOSH:6.0
Platform : MACINTOSH
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.