1 REALLY STUPID question Cocoa support for AppleScript
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.