Skip navigation.
 
mlAppleScript little problem...
FROM : Nico
DATE : Mon Dec 16 20:20:11 2002

Hi !

I partially made my app scriptable. Let me explain : you can type the
"typein" command in script editor, but you can't add an argument.
I've seen numerous examples, but still no luck.

Here are the .scriptSuite, .scriptTerminology and the NSApplication
category i use.
Can you tell me if it's possible just to pass an argument so that the
user can use
tell application "MyApp" too typein "boo"

Any help is *very* appreciated :-)
Thanks in advance.
Nico
---





.scriptSuite
<plist version="1.0">
<dict>
   <key>AppleEventCode</key>
   <string>AKWA</string>
   <key>Classes</key>
   <dict>
       <key>NSApplication</key>
       <dict>
           <key>AppleEventCode</key>
           <string>capp</string>
           <key>Superclass</key>
           <string>NSCoreSuite.NSApplication</string>
           <key>SupportedCommands</key>
           <dict>
               <key>TypeIn</key>
               <string>handleSendCommand:</string>
           </dict>
           <key>ToManyRelationships</key>
           <dict>
               <key>orderedDocuments</key>
               <dict>
                   <key>AppleEventCode</key>
                   <string>docu</string>
                   <key>Type</key>
                   <string>AKDocument</string>
               </dict>
           </dict>
       </dict>
   </dict>
   <key>Commands</key>
   <dict>
       <key>TypeIn</key>
       <dict>
           <key>AppleEventClassCode</key>
           <string>AKWA</string>
           <key>AppleEventCode</key>
           <string>Rvrs</string>
           <key>Arguments</key>
           <dict>
               <key>text</key>
               <dict>
                   <key>AppleEventCode</key>
                   <string>Strn</string>
                   <key>Optional</key>
                   <string>NO</string>
                   <key>Type</key>
                   <string>NSObject</string>
               </dict>
           </dict>
           <key>CommandClass</key>
           <string>NSScriptCommand</string>
           <key>ResultAppleEventCode</key>
           <string>Strn</string>
           <key>Type</key>
           <string>NSString</string>
       </dict>
   </dict>
   <key>Name</key>
   <string>MyApp</string>
   <key>Synonyms</key>
   <dict>
       <key>tact</key>
       <string>NSTextSuite.NSTextStorage</string>
   </dict>
</dict>




.scriptTerminology
<dict>
   <key>Classes</key>
   <dict>
       <key>NSApplication</key>
       <dict>
           <key>Description</key>
           <string>AkwaIRC's top level scripting object.</string>
           <key>Name</key>
           <string>application</string>
           <key>PluralName</key>
           <string>applications</string>
       </dict>
   </dict>
   <key>Commands</key>
   <dict>
       <key>TypeIn</key>
       <dict>
           <key>Arguments</key>
           <dict>
               <key>text</key>
               <dict>
                   <key>AppleEventCode</key>
                   <string>Strn</string>
                   <key>Type</key>
                   <string>NSObject</string>
                   <key>Description</key>
                   <string>fuka string</string>
                   <key>Name</key>
                   <string>text</string>
               </dict>
           </dict>
           <key>Description</key>
           <string>Send some text to the current window.</string>
           <key>Name</key>
           <string>typein</string>
       </dict>
   </dict>
   <key>Description</key>
   <string>AkwaIRC specific classes.</string>
   <key>Name</key>
   <string>AkwaIRC suite</string>
   <key>Synonyms</key>
   <dict>
       <key>tact</key>
       <dict>
           <key>Description</key>
           <string>The textual contents of a text area graphic.</string>
           <key>Name</key>
           <string>text contents</string>
       </dict>
   </dict>
</dict>




and the category :-)
@interface NSApplication (AKScripting)
- (id)handleSendCommand:(NSScriptCommand *)command;
@end

@implementation NSApplication(MyAppScripting)
- (id)handleSendCommand:(NSScriptCommand *)command
{
      // do some stuff
}
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlAppleScript little problem... Nico Dec 16, 20:20
mlRe: AppleScript little problem... Rakesh Pandey Dec 16, 20:42
mlRe: AppleScript little problem... Rakesh Pandey Dec 16, 20:43
mlRe: AppleScript little problem... Glenn Howes Dec 16, 20:44
mlRe: AppleScript little problem... Nico Dec 16, 21:38
mlRe: AppleScript little problem... Greg Titus Dec 17, 01:05
mlRe: AppleScript little problem... Nico Dec 17, 06:11
mlRe: AppleScript little problem... David Remahl Dec 17, 06:25
mlRe: AppleScript little problem... Nico Dec 17, 06:57