• 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: Paul Berkowitz <email@hidden>
  • Date: Fri, 14 Dec 2007 14:10:28 -0800
  • Thread-topic: Determine if a Word Document is New or Saved

Title: Re: Determine if a Word Document is New or Saved
On 12/14/07 1:57 PM, "email@hidden" <email@hidden> wrote:


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

The only copies of Word 2008 out now are either NDA or stolen. But if what you say is true, then you should use 'full name' since it would work the same for both 2004 and 2008.

It was always un-Mac-like that the 'path' property (derived from the equivalent VBA Property) was actually the path to the containing folder (or disk) rather than to the document. In all other Mac apps, 'path' includes the file itself. Of course, this sort of makes 'full name' redundant, since it returns the same thing.

--
Paul Berkowitz
 _______________________________________________
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

References: 
 >Re: Determine if a Word Document is New or Saved (From: <email@hidden>)

  • Prev by Date: Re: Dumb Finder scripting question
  • Next by Date: Re: Dumb Finder scripting question
  • Previous by thread: Re: Determine if a Word Document is New or Saved
  • Next by thread: Re: Excel 2004
  • Index(es):
    • Date
    • Thread