לע"נ ר' אלכסנדר זושא ב"ר יוסף
מרת אלטע חנה בת ר' מאיר זאב
The Mishna says in Gittin :
מתני׳ כל גט שנכתב שלא לשום אשה פסול כיצד היה עובר בשוק ושמע קול סופרים מקרין איש פלוני מגרש את פלונית ממקום פלוני ואמר זה שמי וזה שם אשתי פסול לגרש בו
Any bill of divorce that was not written for the sake of a specific woman is invalid. How so? In a case of a man who was passing through the marketplace and heard the sound of scribes who write bills of divorce dictating the text to their students: The man so-and-so divorces so-and-so from the place of such and such; and the man said: This is my name and that is the name of my wife, and he wishes to use this bill for his divorce, this bill is unfit for him to divorce his wife with it, as it was not written for the sake of any woman.
יתר מיכן כתב לגרש את אשתו ונמלך מצאו בן עירו ואמר לו שמי כשמך ושם אשתי כשם אשתך פסול לגרש בו
Moreover, if one wrote a bill of divorce with which to divorce his wife but later reconsidered, and a resident of his town found him and said to him: My name is the same as your name, and my wife’s name is the same as your wife’s name, and we reside in the same town; give me the bill of divorce and I will use it; the bill of divorce is unfit for the second man to divorce his wife with it.
יתר מיכן היו לו שתי נשים ושמותיהן שוות כתב לגרש את הגדולה לא יגרש בו את הקטנה
Moreover, if one had two wives and their names were identical, and he wrote a bill of divorce to divorce the older one and then reconsidered, he may not divorce the younger one with it.
יתר מיכן אמר ללבלר כתוב לאיזו שארצה אגרש פסול לגרש בו:
Moreover, if he said to the scribe: Write a bill of divorce for whichever one of them that I will want and I will divorce her with it, this bill of divorce is unfit for him to divorce either wife with it.
What is the halacha, if the husband when he was writing the get had a מחשבה that this get is for someone other than his wife but he KNEW that למעשה - he was writing this get to give to his wife?
Rav Shmuel Auerbach suggested that it would appear that such a מחשבה wouldn't shter [impede] the get and it would be valid. Even though the gemara [Zevachim 2] compares gittin to kodshim and the halacha is that a מחשבה that this עולה will be a שלמים invalidates the korban even though he knows it will be brought as an עולה - the two halachos aren't EXACTLY comparable. When it comes to gittin, סתם מחשבות are meaningless and what is necessary to invalidate the get is a מחשבה that the get will actually be given to a different woman while regarding kodshim there is a din of פסלות במחשבה, that one's thoughts determine that kashrus of the korban [even if he know that his thoughts are impossible to carry out because like we said - an עולה can't magically turn into a שלמים].
That being said MAYBE when it comes to the עדים the halacha is different and a סתם מחשבה of the עד that this get is being signed for a different woman than the one he knows it is actually being given to invalidates the get.
With respect to the husband we follow his thoughts about בפועל - to whom the get will actually be given, while with respect to the עדים we follow even their סתם מחשבות about whom they are signing for even though they know that the get will be given to someone else.
This theory requires more proof. But if true it would answer a question of Rebbe Akiva Eiger [ב, ב ד"ה ורבנן] who asked how can there ever be a פסול of עדים signing שלא לשמה for a get when the halacha of every שטר is that the signing must be מדעת המתחייב. So when the עדים sign, if they had kavana for someone else not like the husband - it would be pasul in every case of a shtar and not only here? And if they are signing לשם עדות זו - it is automatically מדעת המתחייב and kosher? If the above mentioned theory is true we can find a case of שלא לשמה for the עדים that is still מדעת המתחייב. They signed with the דעת המתחייב that בפועל the get will be given to this man's wife but had a מחשבה that they are signing for another woman. So it IS מדעת המתחייב - exactly the husband's intentions to give the get to his wife but they added on a סתם מחשבה that they are signing for someone else. THAT is שלא לשמה בעדים.
[עפ"י דברי הגר"ש זצ"ל]