-
-
Save adomasven/a8f64821de4d44a7dd53bb77e2ea6c13 to your computer and use it in GitHub Desktop.
Zotero Get macOS version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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