If you test immediately after the action, this should work:
try taking the apple;
if rule succeeded [...]
It’s supposed to be the case that any action that ends prior to reaching its carry out rules fails and any that get as far as their carry out rules succeed. But unless you check each action in the Standard Rules, you’re liable to be wrong some of the time about what is and isn’t a failure.
Some actions whose default responses sound kind of failure-ish (squeeze thing => “You achieve nothing by that.”; consult book about halitosis => “You discover nothing of interest in the book”) are successes. Some things that sound not-especially-failure-ish (think => “What a good idea”; sleep => “You aren’t feeling especially drowsy.”) are failures. And try asking bob to try going north succeeds or fails based on whether the player’s persuasion of Bob succeeded or failed, regardless of whether Bob successfully went north.
If one abused Instead rules to simulate a successful action (a practice that can be seen in numerous examples in the docs), e.g.,
Instead of taking the apple: now the player carries the apple; say "You grab the apple."
that would be a failure despite looking like a success.
Or suppose one wrote:
foo is a rulebook.
foo: rule fails.
after an actor doing anything: abide by the foo rules; continue the action.
One would almost certainly have meant to have written follow the foo rules instead of abide by the foo rules. But if one had written that, it’d now be the case that if rule succeeded would be false for all in-world actions for which the foo rulebook failed (in a less contrived case we’d expect that Foo probably succeeds some of the time). So it’s possible to break the efficacy of if rule succeeded as an “if action succeeded” test.
I talked about this previously where I quoted Zarf:
If you can avoid needing to test for action success, I’d recommend doing so.