osx- opening Privacy>Accessibility window programmatically

https://macosxautomation.com/system-prefs-links.html has a page of links to many, but not all of, the various preference panes. With a little bit of guesswork, I was able to verify that these calls work under macOS Mojave beta 7. I'm using these calls to guide the user to the proper pane when they've denied access to a device that the app can't run without.

// open last Privacy subpane viewed:
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy"]];

// specify a particular subpange
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Camera"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Microphone"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"]];

While searching for the solution, I found generated the following code from some hints in this question which worked for me.

This is what I wanted to implement.

Thanks @duskwuff for supporting with your comment.

NSString *script;
if ([[[[NSProcessInfo processInfo] operatingSystemVersionString] substringToIndex:12] isEqualToString:@"Version 10.7"] || [[[[NSProcessInfo processInfo] operatingSystemVersionString] substringToIndex:12] isEqualToString:@"Version 10.8"])
{ //>> For OSX 10.7 and 10.8
     script = @"tell application \"System Preferences\" \n set the current pane to pane id \"com.apple.preference.universalaccess\" \n activate \n end tell";

     NSAppleScript *scriptObject = [[NSAppleScript alloc] initWithSource:script];
     [scriptObject executeAndReturnError:nil];

}
else
{ //>> For OSX 10.9 and 10.10
    script = @"tell application \"System Preferences\" \n reveal anchor \"Privacy_Accessibility\" of pane id \"com.apple.preference.security\" \n activate \n end tell";

    NSAppleScript *scriptObject = [[NSAppleScript alloc] initWithSource:script];
    [scriptObject executeAndReturnError:nil];
}