How to save some string to file?

I mean no popup. I think about possibility of combining Addon with external AHK application. To make it easier the AHK is script which user or programmer of the script can simply modify by specifying position of the button. So for this purposes or possibilities I thought it is better to make it as easy as possible. Because with a popup there is need to add a delay/sleep, and it is more complicated. But I say, this is external App, not part of FF. There are more options how to use addons. Originally I worked with AHK for getting data from brower, but it was too complicated, so I would like to try to extend the addon.