Created
February 24, 2016 17:41
-
-
Save nomeyer/ff15af2dd9d57818627b to your computer and use it in GitHub Desktop.
If chain to log the outcome (AXError) of an accessibility operation
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
#include <CoreFoundation/CoreFoundation.h> | |
AXError rtn = AXUIElementCopyAttributeValue(someApp, someAttribute, (CFTypeRef *)&someRef); | |
if (rtn == kAXErrorSuccess) { | |
printf("\nSuccess"); | |
} else if (rtn == kAXErrorInvalidUIElement){ | |
printf("\nInvalid UI Element"); | |
} else if (rtn == kAXErrorIllegalArgument) { | |
printf("\nIllegal argument"); | |
} else if (rtn == kAXErrorCannotComplete) { | |
printf("\nCannot complete"); | |
} else if (rtn == kAXErrorAPIDisabled) { | |
printf("\nAPI disabled"); | |
} else if (rtn == kAXErrorNoValue) { | |
printf("\nNo value"); | |
} else if (rtn == kAXErrorAttributeUnsupported) { | |
printf("\nAttribute unsupported"); | |
} else if (rtn == kAXErrorNotImplemented) { | |
printf("\nNot implemented"); | |
} else { | |
printf("\nunknown"); | |
} | |
fflush(stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment