• 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: save documents problem (reprise)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save documents problem (reprise)


  • Subject: Re: save documents problem (reprise)
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 01 Aug 2002 16:09:15 -0700

On 8/1/02 3:40 PM, "Charles Bennett" <email@hidden> wrote:

> Here it is. All that is running is script editor, Word and Finder
>
> tell application "System Events"
> set theApps to the name of every process whose visible is true
> end tell
>
> repeat with i from 1 to (count theApps)
> set theAppName to item i of theApps
> if theAppName is not "Finder" and theAppName is not "Script Editor" then
> tell theAppName to save documents
> end if
> end repeat
>
> NOW I get the 'Can't get every document of "Microsoft Word"' error
> and if Text Edit is running instead of Word then it tosses the error.

You're just telling a NAME (a string), not an application. You have to tell
the application.

tell application theAppName to save documents

Because you're not using any application-specific keyword, that will
compile and should work, if Word and TextEdit both use the Standard Suite
raw code for 'document' which they probably do. If not, you'll have to add
more 'ifs' and tell the specific application.

Are you sure you won't get a few more apps whose visible is true but which
don't know about 'documents'? By the way, you should be telling the Finder,
not System Events. Apparently it may not always be System Events doing this,
but the Finder will always pass it on to whoever is.

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: save documents problem (reprise)
      • From: Charles Bennett <email@hidden>
References: 
 >save documents problem (reprise) (From: Charles Bennett <email@hidden>)

  • Prev by Date: Move a sound file
  • Next by Date: Re: save documents problem
  • Previous by thread: save documents problem (reprise)
  • Next by thread: Re: save documents problem (reprise)
  • Index(es):
    • Date
    • Thread