https://github.com/groovy/scriptom
Scriptom project, offering a access to Windows / COM / Ole components from Groovy
https://github.com/groovy/scriptom
Last synced: 9 months ago
JSON representation
Scriptom project, offering a access to Windows / COM / Ole components from Groovy
- Host: GitHub
- URL: https://github.com/groovy/scriptom
- Owner: groovy
- Created: 2015-07-21T18:52:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-02-14T12:30:17.000Z (almost 4 years ago)
- Last Synced: 2025-03-20T23:42:02.980Z (9 months ago)
- Language: Java
- Homepage:
- Size: 1.04 MB
- Stars: 21
- Watchers: 10
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= What is Scriptom
**Note**: __Scriptom is not actively maintained.__
**Scriptom** provides a simple yet powerful COM library for Groovy. It is implemented as a thin layer around [JACOB (Java COM Bridge)](https://sourceforge.net/projects/jacob-project/). JACOB is a mature open-source library for Java that supports communicating with COM libraries and automation servers on Microsoft Windows.
**Scriptom** attempts to mirror all the functionality of JACOB, but in a "groovy" way. Here is a quick example that uses
`Scripting.FileSystemObject` to list the paths to all active rooted drives on your system (italics show COM methods and properties):
[source,lang='groovy']
----
new ActiveXObject('Scripting.FileSystemObject').Drives.findAll{it.IsReady}.each{println it.Path} `
----
Visual Basic was never this easy!
== Supported Variant Types and Translation Notes
[cols="5*",options="header"]
|===
| Variant-Type | Supported? | Java | VB6/VBA | Comments
| Empty |Yes|`null`|`Variant.Empty`|
| Null |Yes|`VariantNull`|`Variant.Null`|Don't be confused. `Variant.Null` is not the same as `null`. This is by design.
| Short |Yes|`Short`|`Integer`|An `Integer` in VB6 represents a 16-bit signed value.
| Int |Yes|`Integer`|`Long`|A `Long` in VB6 represents a 32-bit signed value.
| Long |Yes|`Long/BigInteger`| |A 64-bit signed value. Supported by .NET. `BigInteger` supports arbitrary-precision integers, so there may be errors associated with converting a `BigInteger` to a 64-bit integer.
|==
By default, all Variants in **Scriptom** are passed by value (not `byref`). Note that it is safe to pass values `byval`
even when the method argument is marked as 'byref.' In COM, 'byref' arguments allow a method to change a value which is
then reflected in the calling scope. If you need to do this, take a look at the `VariantByref` class. You shouldn't run
into this very often with the standard COM libraries, but isn't it nice to know we've got your back?
Unsigned integer types are also supported by **Scriptom**.
Each COM unsigned type is converted to equivalent signed Java type.