Re: Scripting-system error
Re: Scripting-system error
- Subject: Re: Scripting-system error
- From: John Delacour <email@hidden>
- Date: Wed, 23 Apr 2003 20:41:36 +0100
- Mac-eudora-version: 6.0a16
At 11:20 pm -0400 22/4/03, Monee Kidd wrote:
Could not read the file because of a scripting-system (OSA) error.
I can no longer open my file, from the menu I get the same error
message. Now what is my problem?!? I had a copy of my silly little
script, I paste it here to see if you can tell me what is something
wrong with it:
tell application "TextEdit"
activate
open alias "Macintosh HD:Users:imani08:Documents:Test.rtf"
set Things_To_Know to text of document "test.rtf"
say "Here's what you need to know: " & Things_To_Know
quit
end tell
Help! I'm ultimately going to put this into a larger script that I
have that I don't want to mess up, what's wrong?
--
If you look at the open verb in the dictionary you will read:
open : Open an object.
open [ a list of alias] -- list of objects
It is best to believe the dictionary in the first instance. 'open'
wants a LIST of alias (or, in fact, file specs). Eudora, for
example, will insist very firmly on this.
I have tried this script both from the editor and as an applet and
there are no problems. When you are writing applets, you should
always wrap things in informative try traps so that you can see where
you're going wrong.
set f to "" & (path to "cusr") & "test.rtf" as file specification
tell app "TextEdit"
try
open {f}
on error e
display dialog e & return & "open {f}"
end
set s to text of document "test.rtf"
say "Here's what you need to know: " & s
quit
end
_______________________________________________
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.