开发者

Creating a new document via AppleScript results in a document with no title

I am making a Cocoa NSDocument-based app scriptable. If I try to create a new document with the following AppleScript:

tell application "MyApp" to make new document

a new document is created, but its title is nil. Any ideas on why this would happen and how to fix it开发者_JAVA技巧?


I took a quick look at the TextEdit developer example code (/Developer/Examples/TextEdit) to see if it sheds any light on this. There's a comment in Document.m's -init method that says:

// Assume the default file type for now, since -initWithType:error: 
does not currently get called when creating documents using 
AppleScript. (4165700)

Could that have something to do with the problem? Do you have multiple document types defined?

If that's not it, you might want to post your .scriptsuite and .scriptterminology files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜