Unknown reason for applciation crash
Unknown reason for applciation crash
- Subject: Unknown reason for applciation crash
- From: email@hidden
- Date: Tue, 8 Nov 2005 17:02:07 EST
I've written the script below to help me to outline and review
lengthy documents--a chore that I am doing a lot of
of late.
It works well with Tex-Edit Plus, however, when written to
Microsoft Word (as it is below), I receive a message from the Finder
"Microsoft Word has quit."
The document that this script's action is directed towards has
its paragraphs numbered (I have accomplished that with a different
script that makes a new "paragraph" before each existing
paragraph of some original document I wish to review; the new
"paragraphs" have content of just the numbers "1", "2", and so on
until all the document's paragraphs are, in effect, numbered).
Has anyone an inkling as to what's causing the
Microsoft Word crash?
display dialog ¬
"This script presumes that your document has already been enumerated
Enter your search term string:" default answer "" with icon 1
set theString to text returned of result
set allNumerals to ""
tell application "Microsoft Word"
set numberOfParagraphs to count of paragraphs of document 1
set paragraphIndex1 to 1
set paragraphIndex2 to 2
repeat until paragraphIndex2 is numberOfParagraphs + 2
set numeralParagraph to paragraph paragraphIndex1 of document 1
set textContainingParagraph to paragraph paragraphIndex2 of document 1
if textContainingParagraph contains theString is true then
set theNumeral to first character of numeralParagraph
set allNumerals to allNumerals & theNumeral & "," & space
end if
set paragraphIndex1 to paragraphIndex1 + 2
set paragraphIndex2 to paragraphIndex2 + 2
end repeat
end tell
allNumerals as text
PS My system information:
Mac OS 9.2.1, AppleScript 1.8.3, Microsoft Office '98
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden