[cocoa scripting] default sub container
[cocoa scripting] default sub container
- Subject: [cocoa scripting] default sub container
- From: Ken Victor <email@hidden>
- Date: Mon, 5 Sep 2005 09:49:19 -0700
i have a multi doc application. however, the vast majority of the
time only one document will be open at a time. by default, most
scripts must thus be like:
tell application "myApp"
tell document 1
<commands>
end tell
end tell
i (think i) would like to be able to write scripts more like:
tell application "myApp"
<commands>
end tell
ie, not need to specify the document, and if there is only one
document, then pass along the commands to that document; but if there
is more than one document open, then return an appropriate error.
2 questions:
1) is this possible?
2) and if this is possible, is it a good idea?
i can make this happen by "replicating" all the
elements/properties/commands of my document in my sdef file as
elements/properties/commands of the application, but i don't want to
do this--at least not in a user visible way. so i think this might be
doable by subclassing NSScriptSuiteRegistry and
NSScriptClassDescription. is that correct?
thanx for any thoughts and/or suggestions.
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden