Wait for external application to finish
I'm using FMP 8.5 and have a script that runs an application created with Automator (it gets a URL from a field in my database and downloads a .pdf file with that name into a folder) and then runs native Applescript code that changes the name of the .pdf file that was downloaded. I need the FMP script to wait for the application downloading the .pdf file to finish before running the Applescript code that changes the file name. I tried using a repeat loop in Applescript to wait for the Automator application to finish running but that seemed to hang up the Automator application waiting to get the URL from FMP.
repeat while application "Download URL" is running
What is the best way to wait for the application to finish before running the Applescript step to change the file name?