Question:
Non-Jew asks to borrow a book from a Jew. The Jew fumbles around in a dark room looking for the book, and the non Jew turns on the light.
The non-Jew did the melacha for the Jew, but really he did it for himself so that the Jew can find the book faster.
Answer:
It would seem that the gentile is actualy doing it for his own benefit, therefore it is permitted.
Best wishes
Additional reading:
- Amira Le-Akum in Pesik Reisha
- Asking a non-jew to ask another to do melacha on Shabbos
- Gentile manager at simcha on Shabbos
- If someone forgot to light a yahrtzeit candle Friday night can the goy be asked to light it?
- Laundry service making pickup on Shabbos
- amira lakum during bein hashmashos
- Asking gentile to plug in crock pot on Shabbos