TextEdit, AppleScript, Opening Files

chief

Registered
Does anyone know how to get TextEdit to open a file from an AppleScript. I tried the logical:
tell application "TextEdit"
open file "Drive Name:Users:username:Desktop:testing.rtf"
end tell

But it doesn't work. Tells me that the file doesn't understand the open command. But if I substitute "AppleWorks 6" for the application, it works fine. What gives? :confused: I know this version of TextEdit is scriptable because it uses some sample scripts like the font sampler script.

please help.

sidenote: the smiley in the code is funny, though, isn't it? How do you escape that if you want to use vB code in a post?
 
Nope. Same error.

Code:
TextEdit got an error: file "Drive Name:Users:username:Desktop:testing.rtf" doesn't understand the open message.
 
It's been a year and you don't have this problem anynore but I did tonight, with a different app, and solved it :D

it applies to TextEdit too:

Code:
tell application "TextEdit"
	open "Drive Name:Users:username:Desktop:testing.rtf" as alias
end tell

maybe someone will find this useful ... I sure would have!
 
Back
Top