I would like to ask Prof. X, a distinguished scholar at a top school, for a recommendation for a tenure-track academic position. However, I only want him to write me a recommendation if he is going to write a good one. If he will write me a mediocre or just insufficiently positive recommendation, I would prefer to have someone less famous than X but more positive about me write the letter.
If I simply ask Prof. X for a letter, there is the possibility that he will agree and then write something that is not as positive as I would like. I want to avoid this.
One way to solve this problem would be for me to ask Prof. X if he is sufficiently familiar with my work to write me a strong letter. If he does not wish to write me a strong letter, he can simply reply that he is not that familiar with the whole body of my work. By giving him an easy way to decline, this makes it more likely that he will write a strong letter if he accepts.
Unfortunately, in this case this little strategem will not work, as Prof. X and I have been working on the same questions for years, so there is little question of him being unfamiliar with my results.
Another possible solution would be to have someone else approach him to ask whether he can write me a strong letter. Sadly I have no one who could do this for me.
What would be a good strategy to use in this situation? More broadly, what are some general tips for asking people for recommendation letters which ensure you only get strong letters, besides the two I mentioned above?
Edited: Maybe I should mention a couple of other strategies that crossed my mind:
A. Mention to Prof. X that I'm going on the job market in unrelated conversation and see if he volunteers to write me a letter.
B. Ask him for a letter in an email and see how he responds. If he responds enthusiastically, e.g., "It would be my pleasure to write you a letter..." or "I'd be extremely happy to..." this is good. If he only responds neutrally, e.g., "Sure, I can write you a letter" then simply neglect to follow up with him and ask someone else for the letter.
Both of these strategies are decent, but they are not perfect. They might work, but they also might cause me to miss out on a good letter from a well-known scholar. Anyway, I'd welcome thoughts, corrections, additional strategies to use that I haven't thought of, etc.