• 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
1 REALLY STUPID question Cocoa support for AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

1 REALLY STUPID question Cocoa support for AppleScript


  • Subject: 1 REALLY STUPID question Cocoa support for AppleScript
  • From: Stéphane Sudre <email@hidden>
  • Date: Sat, 10 Jul 2004 16:48:32 +0200

What is the script you need to write in Script Editor to tell a Multi-document application to open one of its document?

I tried this and it does not work obviously:

set tFilePath to "Mac OS X:Users:stephane:myDocument.txt"

tell application "TextEdit"

activate

set tDocument to open file (tFilePath)

end tell

/* Example taken from a script written for InDesign I found on the web */

The answer from Script Editor is:

'TextEdit got an error: file "Mac OS X:Users:stephane:myDocument.txt" doesn't understand the open message.'

Surprisingly, I haven't found any simple sample code showing how to do this in any of the article, tutorial, documentation I've read as of today. This includes:

- MacDevCenter

- Apple's own AppleScript web site

- A lot of web sites dedicated to AppleScript.

All these sites explains you how to do things in the Finder, iTunes, how to handle already opened documents, how to create a document, etc... but NEVER how to open a document. That's crazy!

So any solution is welcome.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: 1 REALLY STUPID question Cocoa support for AppleScript
      • From: Ronald Hofmann <email@hidden>
  • Prev by Date: Re: How to get vended object on app running on another host
  • Next by Date: Re: Compositing Tricks?
  • Previous by thread: Re: What's better a separate run loop or separate thread?
  • Next by thread: Re: 1 REALLY STUPID question Cocoa support for AppleScript
  • Index(es):
    • Date
    • Thread