Your A/C has a NEMA 6-15P, which is intended for a three wire (hot-hot-ground) 15A 120/240V single phase service.
I'm assuming you are essentially asking if a (long enough) extension cord for 15Amp three-wire 120/240V service exists with a "P" (male, plug) NEMA 10-30 on one end and an "R" (female, receptacle) NEMA 6-15R on the other? I don't believe you can find a cord like that and it would not be safe to make one yourself out of discrete parts and a length of thick three-wire cable either :
The only safe way to power your new A/C would be to pull a new cable from the panel. The now obsolete NEMA 10 connectors did not have a ground wire in them, which was legal before 1996 NEC but not anymore. If your dryer was wired prior to that, and the extension cord like you're asking about existed, you would end up with three wires carrying hot, hot and neutral connected to a device that expects hot, hot and ground, i.e. its metal body parts would be connected to the neutral conductor. I would avoid that because if anything happens to the neutral conductor between you and its grounding point, there may be potentially dangerous voltages on the neutral.
Please call the electrician and install a proper and safe NEMA 6-16R receptacle for the A/C permanently near the window.
Or return the 18,000 BTU 240V unit and get a smaller one that plugs into the normal NEMA 5-15R? Like this 14,000 BTU Grainger sells: