Re: Determine if a Word Document is New or Saved
Re: Determine if a Word Document is New or Saved
- Subject: Re: Determine if a Word Document is New or Saved
- From: Stan Cleveland <email@hidden>
- Date: Fri, 14 Dec 2007 13:43:42 -0800
- Thread-topic: Determine if a Word Document is New or Saved
On 12/14/07 1:20 PM, email@hidden wrote:
>
> That was it. A bit thank you to the two of you. In my issue, I will not know
> the name of the document, but I came up with this as a bit of an add on. (This
> runs as it should under Word 08 anyways)
>
> tell application "Microsoft Word"
> if path of active document contains ":" then
> display dialog "Old Document"
> else
> display dialog "New Document"
> end if
> end tell
Brian, your code will give the wrong result if the document is saved at the
root of the startup drive. In that case, the ³path² property returns just
the drive name with *no* colon (³MacOS² OMM). I think the following would be
safer:
tell application "Microsoft Word"
if path of active document is "" then
display dialog "New Document"
else
display dialog "Old Document"
end if
end tell
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden