| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Somehow, this still isn't working. Here's some code. filesToProcess is a list of dropped files. on commonCode() getEditorInitials() --main loop to work through list of files repeat with s from 1 to count of items in filesToProcess set currentStory to item s of filesToProcess tell application "Microsoft Word" activate open file currentStory set wholeStory to (create range active document start 0 end (count of characters in active document)) end tell my formatStoryText(wholeStory) my errorCheck(wholeStory) my getStoryParts(wholeStory) end repeat end commonCode() on editorInitials() <commands that work dandy> .... end editorInitials on formatStoryText(wholeStory) <some commands that seem to work fine> ..... end formatStoryText on errorCheck(wholeStory) <more commands that work fine> ... end errorCheck on getStoryParts(wholeStory) set wholeStoryText to content of wholeStory if paragraph 1 of wholeStoryText is "" then beep end if end getStoryParts The script crashes in getStoryParts with a message saying "Can't get paragraph 1 of missing value." The last command in the log before the crash message is where it tries to get the content of wholeStory, for which the result is "missing value." I also tried getting the content of the text object of wholeStory, with identical results. So, it would seem that the problem is not wholeStory getting passed correctly, since the other routines seem to be getting it, but, on the other hand, this works fine: tell application "Microsoft Word" set wholeStory to (create range active document start 0 end (count of characters in active document)) set wholeText to content of wholeStory if paragraph 2 of wholeText is "" then --paragraph 2 is blank display dialog "we got nothin!" --this dialog comes up as expected else display dialog "We got text!" end if end tell I'm SO confused. Thanks, Larry 10:01 PM, Olof Hellman wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
| References: | |
| >Re: Passing MS Word object specs (Larry the O) (From: Olof Hellman <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.