OSAXen
Fixer for REALbasic
Download
version 1.0 (17K)
OSAXen Fixer makes it possible for REALbasic
applications to invoke AppleScript Scripting Additions directly (i.e.
without using AppleScript) on MacOS X systems.
This document explains how to install and use the OSAXen Fixer
plugin.
License
THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTY
OF ANY KIND. THE AUTHOR DISCLAIMS ANY DAMAGES RESULTING FROM THE USE OR
MISUSE OF THIS SOFTWARE.
THIS SOFTWARE IS COPYRIGHT (C) 2001 LATE NIGHT SOFTWARE
LTD - ALL RIGHTS RESERVED. THIS SOFTWARE MAY BE DISTRIBUTED FREELY AND
INCORPORATED INTO LARGER WORKS.
Scripting Additions and MacOS X
On classic MacOS systems
it is possible to invoke a Scripting Addition by simply sending the addition's
AppleEvent to yourself. It is also possible to invoke Scripting Additions in other
applications by sending the addition's AppleEvent to any other process.
However, under MacOS X the rules change dramatically. It is still possible to invoke Scripting
Additions within the current application
with the aid of OSAXen Fixer. It is no longer possible to invoke Scripting Additions within
other applications.
Installation
Copy the OSAXen Fixer file to your REALbasic Plugins
folder and restart the REALbasic IDE if it is already running.
Usage
When your REALbasic application starts, you must execute
the following code to initialize the system's Scripting Additions AppleEvent
handlers :
Sub InitializeScriptingAdditions()
dim a as AppleEvent
dim r as boolean
' Install the
standard AppleEvent handlers for all installed
' Scripting Additions.
Strictly speaking, this only needs to
' be done once
per application launch.
InstallStandardAEHandlers
' from OSAXen Fixer plugin
a = NewAppleEvent("ascr",
"gdut", "")
r = a.send
End Sub
The included example REALbasic project illustrates how
to use this code.
NOTE: The REALbasic
3.1 IDE crashes when sending AppleEvents to itself. To see the example in action, run it as a built application.
|