Skip to content

Instantly share code, notes, and snippets.

@adomasven
Created March 30, 2022 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adomasven/a8f64821de4d44a7dd53bb77e2ea6c13 to your computer and use it in GitHub Desktop.
Save adomasven/a8f64821de4d44a7dd53bb77e2ea6c13 to your computer and use it in GitHub Desktop.
Zotero Get macOS version
Components.utils.import("resource://gre/modules/ctypes.jsm");
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var resHandler = ios.getProtocolHandler("resource")
.QueryInterface(Components.interfaces.nsIResProtocolHandler);
var fileURI = resHandler.getSubstitution("zotero-macword-integration")
.QueryInterface(Components.interfaces.nsIFileURL);
libPath = fileURI.file;
libPath.append("libZoteroWordIntegration.dylib");
lib = ctypes.open(libPath.path);
var statusCode = ctypes.unsigned_short;
var getMacOSVersion = lib.declare("getMacOSVersion", ctypes.default_abi, ctypes.char.ptr);
getMacOSVersion().readString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment