def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("/osascript"),
            " -e " in event.deep_get("CommandLine", default=""),
            "clipboard" in event.deep_get("CommandLine", default=""),
            not all(
                [
                    event.deep_get("ParentImage", default="").endswith("opencode"),
                    "osascript" in event.deep_get("CommandLine", default=""),
                    " -e " in event.deep_get("CommandLine", default=""),
                    "set imageData to the clipboard" in event.deep_get("CommandLine", default=""),
                    "set fileRef" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
