How to apply for professorship in another field? I am an associate professor of chemistry and all my education was in chemistry programs too. But my works were always in computational science. I developed various programs for analyzing chemical data. All I work with are programming language and algorithms.

I prefer to work in a computer department where I can use my skills for other applications (than chemistry) and work with colleagues who have knowledge about programming.

Can I apply for an assistant professorship in a department of computer science? How can I convince them that my experiences are comparable with computer education?

My worry is that because any academic position includes teaching at undergraduate level, department does not allow me to teach course as I have not studied that curriculum.
With due attention to the fact that within that CS department, there might be many affiliated faculty members, are who proficient in programming and capable of teaching, your tendency might not, reasonably, lead to the desired outcome.

As the programming skills, nowadays, are essential for different scientific disciplines, I suggest you try to convince the department, in a proposal-based manner, to define a programming-driven course for students corresponding to your home department, you say, containing the fundamentals of the simulating chemical processes (If it has not been already existed, of course)...

Such scenario would sound more functional for you to follow your interest.