Force Applescripts to top running

I have been having multiple problems with an Applescript I have developed for automating some processes between InDesign and Acrobat Pro. I have posted a couple but nobody has been able to help. I have decided to try and tackle these problems one by one.

First issue is that when I run the script it often crashes Acrobat Pro and what happens then is that I have to wait for InDesign to time out before (realise that the script can no longer run) before I can do anything… and this can take like 5 mins. Then when I try run it again it just wont work at all and needs to time out a second or third time taking a total of a bout 15 mins to be able to get back to running the script normally again.

I think the problem is that there is a background process that controls the compilation or running of Applescripts and it takes quite a long time for it to realise that the script can no longer run.

Can anybody tell me if I am correct in saying this and what process it is that controls this so that I can force quit it. Also is there a way to tell the script its self to manage this its self.

Ok I have worked out what is going on… I do have a procedure in place that if the program fails that a alert dialog appears and informs the user of the issue… only problem is when Acrobat crashes, that alert dialog is sent to the back of all the windows… so the script keeps running until that alert is clicked… but nobody knows it is there.

How do I get the alert to display at the front? I tried using system events to get the name of the front most application and telling it to display the alert but that didn’t work.

Fixed… All I was missing was telling the application to “Activate” to force all windows and dialogs to the front.