• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determine if a Word Document is New or Saved
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determine if a Word Document is New or Saved


  • Subject: Re: Determine if a Word Document is New or Saved
  • From: <email@hidden>
  • Date: Fri, 14 Dec 2007 13:57:06 -0800 (PST)



Stan Cleveland <email@hidden> wrote:
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.

In Word 04 and below, that would be the "save way" to run it.  However, in the new Word 08 the "path" and "full name" both pass the file name included. I had to make the adjustment after I realized the differences.

thus:

tell application "Microsoft Word"
    path of active document
end tell

In Word 2008 returns:
-->>"Document1" or
--> "Mac HD:Users:User1:Documents:Document1.doc"

Word 2004 returns:
-->> "" or
--> "Mac HD:Users:User1:Documents"

Thanks again!

Brian
 _______________________________________________
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

  • Follow-Ups:
    • Re: Determine if a Word Document is New or Saved
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Determine if a Word Document is New or Saved (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Determine if a Word Document is New or Saved
  • Next by Date: Re: Opening the newest file in a folder
  • Previous by thread: Re: Determine if a Word Document is New or Saved
  • Next by thread: Re: Determine if a Word Document is New or Saved
  • Index(es):
    • Date
    • Thread