Find Song Lyrics

This example presents how Automa can be used to automate the process of searching for the lyrics of a song on Google, and saving them in a Microsoft Word file.

def find_lyrics():
	print 'Please minimize all other open windows, then enter the song:'
	song = raw_input()
	# Disable Google's autocompletion and set the language to English:
	google_address = ''
	start("firefox", google_address)
	write(song + ' lyrics filetype:txt')
	click("I'm Feeling Lucky")
	press(CTRL + 'a', CTRL + 'c')
	press(ALT + F4)
	start("Microsoft Word")
	press(CTRL + 'v')
	press(CTRL + 's')
	write(song + ' lyrics', into="File name")
	press(ALT + F4)
	print("\nThe lyrics have been saved in file '%s lyrics' "
	      "on your desktop." % song)