Skip to content

SillyUtility/Rx-Editor

Repository files navigation

Rx Editor

./assets/icon-sm.png

Rx Editor is a script editor with a interactive interpreter (REPL). Rx is also a dialect of AppleScript expressed in JavaScript that should be easier and more familiar than the Apple JS binding.

AppleScript drives me crazy. It isn’t interactive like every other scripting language. It is too verbose (and that’s coming from someone that loves ObjC). Worst of all, it isn’t discoverable.

At some point Apple attempted to fix AppleScript by providing JavaScript bindings. Unfortunately, the JS bindings don’t make scripting much better. The Apple provided JS bindings suffer from all the afflictions of AppleScript, but with a vaguely JS feel.

Rx Editor is my attempt to make scripting suck less.

Requirements

  • JavaScriptCore with the ObjC API requires macOS 10.9
  • XPC requires macOS 10.8
  • NSXMLDocumentXInclude requires macOS 10.12
  • ScriptingBridge requires macOS 10.5
  • OSAKit some requires macOS 10.6, some macOS 10.10
  • stringByApplyingTransform:reverse: requires macOS 10.11

The minimum macOS version supported is therefore macOS 10.12 because of the use of NSXMLDocumentXInclude.

Development Notes

Mostly reference materials I fing myself needing as I develop Rx.

Scripting headers

  • OSAKit/OSAKit.h
  • ScriptingBridge/ScriptingBridge.h
  • Foundation/NSAppleEventDescriptor.h
  • Foundation/NSAppleEventManager.h
  • Foundation/NSAppleScript.h
  • Foundation/NSObjectScripting.h
  • Foundation/NSUserScriptTask.h
  • Foundation/NSScriptSuiteRegistry.h
  • Foundation/NSScriptClassDescription.h
  • Foundation/NSScriptCoercionHandler.h
  • Foundation/NSScriptCommand.h
  • Foundation/NSScriptCommandDescription.h
  • Foundation/NSScriptExecutionContext.h
  • Foundation/NSScriptKeyValueCoding.h
  • Foundation/NSScriptObjectSpecifiers.h
  • Foundation/NSScriptStandardSuiteCommands.h
  • Foundation/NSScriptSuiteRegistry.h
  • Foundation/NSScriptWhoseTests.h
  • CoreServices/AE/AE.h
  • Carbon/OpenScripting/OpenScripting.h
  • Carbon/HIToolbox/AEInteraction.h
  • AppKit/NSAppleScriptExtensions.h
  • AppKit/NSApplicationScripting.h
  • AppKit/NSDocumentScripting.h
  • AppKit/NSTextStorageScripting.h
  • AppKit/NSWindowScripting.h
  • AppleScriptKit/ASKPluginObject.h
  • AppleScriptObjC/AppleScriptObjC.h

Apple scripting documentation

Scripting type equivalents

Objective-C typeJavaScript typeAppleScript type
nilundefinednull
NSNullnullmissing value
NSStringstringtext
longnumberinteger
long longnumberdouble integer
doublenumberreal
NSNumbernumber, booleaninteger, real, number, boolean
NSNumber (BOOL)booleanboolean
NSNumber (OSType)numbertype
NSDictionaryObject objectrecord
NSArrayArray objectlist
NSDateDate objectdate
NSBlock (1)Function object (1)script
id (2)Wrapper object (2)any
Class (3)Constructor object (3)
CGPoint{ x: #, y: # }point
NSRange{ location: #, length: # }
CGRect{ x: #, y: #, width: #, height: # }rectangle
CGSize{ width: #, height: # }

Implemented AppleScript types

  • [ ] any
  • [X] text
  • [X] integer
  • [X] real
  • [X] number
  • [X] boolean
  • [ ] specifier, reference
  • [ ] location specifier
  • [X] record
  • [X] date
  • [ ] file, alias
  • [X] point
  • [X] rectangle
  • [X] type
  • [ ] missing value
  • or the name of a class, enumeration, record-type, or value-type defined elsewhere in the sdef
  • To specify a complex type such as “list of integer” or “number or text”, use a type element <type type="integer" list="yes"/>, or
<property name="frequency">
  <type type="number"/>
  <type type="text"/>
</property>

What is a specifier? It’s an unevaluated path to an object.

About

Alternative macOS scripting dialect and editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages