if you want to avoid the battle against the heartless (or you want to find them easily for quest completion) try this easy trick:
stay low on AP and click on the treasure chest you want to open/fight.
the player will automatically try to open/fight it, so from this reaction you can understand if it's what you're searching for:
If it's a heartless but you want a treasure chest, just don't refill your ap and find another, the other way around if you find a tresure chest but want a heartless.
i just figured it out, so, good hunt
stay low on AP and click on the treasure chest you want to open/fight.
the player will automatically try to open/fight it, so from this reaction you can understand if it's what you're searching for:
If it's a heartless but you want a treasure chest, just don't refill your ap and find another, the other way around if you find a tresure chest but want a heartless.
i just figured it out, so, good hunt