NSAppleScript
last edited September 15, 2008 11:00:36 (213.130.142.210)
| |
|---|---|
| Edit / History / New / Search | Quick Links: Home / Recent Changes / Glossary / Jobs / Forums / Help |
|
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSAppleScript_Class/index.html
NSAppleScript is a great tool in inter-application communication. It can execute raw AppleScript code, compiled AppleScript code and AppleEvents. It can then return anything that has been generated in the external code. Some hints:
Sample source code:
The AppleScript Language Guide: http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/index.html
Note that NSAppleScript is pretty much superseded by ScriptingBridge? in Mac OS X 10.5 Leopard. ScriptingBridge? is much easier to use, however it is only available to Leopard apps.
Not entirely true: NSAppleScript is still recommended for executing user-supplied scripts within your application (what AppleScripters? call 'attachability), c.f. System Events' folder actions, Mail's 'run AppleScript' rule action, etc. Users wanting to send Apple events directly from ObjC might also consider ObjCAppscript, which provides significantly better application compatibility than ScriptingBridge? and works on Mac OS X 10.3.9 and 10.4.x as well. -- hhas | |
| Edit / History / New / Search | Quick Links: Home / Recent Changes / Glossary / Jobs / Forums / Help |