I wrote a guest article on the Adobe.io blog.
If the information presented there proves useful, please give the article a few ‘hand-claps’ by clicking the ‘hand-clap’ icon at the end of the article. This helps raise the article’s profile!
Have a look here:
https://medium.com/adobe-io/how-to-write-an-indesign-call-on-idle-script-6b540073f391