Difference between revisions of "Mac OS X Porting - AppleScript Support"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Basic Support)
 
(2 intermediate revisions by one other user not shown)
Line 18: Line 18:
  
 
2.  Create a "sdef" scripting definitions file and put it in the bundle
 
2.  Create a "sdef" scripting definitions file and put it in the bundle
<br>  Stub file, insert in bundle in Resources folder -> OOo.sdef in [[File:OOo.sdef.zip]]
+
<br>  Stub file, insert in bundle in Resources folder -> OOo.sdef in [[File:OOo_sdef.gz]]
<br>  You can now run the following AppleScript -> OOoAS.applescript in [[File:OOoAS.applescript.zip]]
+
<br>  You can now run the following AppleScript -> OOoAS.applescript in [[File:OOo_applescript.gz]]
  
 
3.  Design scriptable "helper" classes that implement the object hierarchy. [http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_design_apps/chapter_3_section_3.html]
 
3.  Design scriptable "helper" classes that implement the object hierarchy. [http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_design_apps/chapter_3_section_3.html]
Line 35: Line 35:
  
 
--[[User:Msicotte|Msicotte]] 19:53, 28 June 2008 (CEST)
 
--[[User:Msicotte|Msicotte]] 19:53, 28 June 2008 (CEST)
 +
[[Category:MacOSX]]

Latest revision as of 11:00, 16 December 2009

Feature Justification

AppleScript support is basic to a Mac OS X application. Supporting Applescript will have the additional benefit of allowing scripting using JavaScript, Ruby, Python, and Objective-C via the AppleScript Scripting Bridge [1]

Basic Support

In order to add Applescript support to OOo the following basic steps need to be accomplished.

1. Turn on scripting support - see Apple Documentation http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_implement/chapter_4_section_7.html#//apple_ref/doc/uid/20000037-1081046]
Insert the following a the end of the Info.plist in the bundle just before /dict
snip---------------------
<key>OSAScriptingDefinition</key>
<string>OOo.sdef</string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
snip---------------------

2. Create a "sdef" scripting definitions file and put it in the bundle
Stub file, insert in bundle in Resources folder -> OOo.sdef in File:OOo sdef.gz
You can now run the following AppleScript -> OOoAS.applescript in File:OOo applescript.gz

3. Design scriptable "helper" classes that implement the object hierarchy. [2]

Extending Support

Phase 1 - Define suites (object model) for OOo
Phase 2 - Implement a subset of the most useful objects
Phase 3 - Verify support for Standard and Text Suites
Phase 4 - Make the OOo uno model AppleScript-able

--Msicotte 20:41, 12 June 2008 (CEST)

Adding Support for AppleScript to the Scripting Framework

This Apple Technote [3] describes calling Applescript from C - a first step to adding AppleScript support to the scripting framework. The example is Carbon - so not exactly what we want since Carbon is deprecated, but the Cocoa example links to the same page.

--Msicotte 19:53, 28 June 2008 (CEST)

Personal tools