Problem with repeat loop in Quark

I’m writing a drag-and-drop script to set a number of document preferences on the Quark docs dragged onto it. The script works for the most part with a couple glitches:

  1. For some reason, it successfully processes all but the last file in a group of files dragged onto it.
  2. It sometimes gives me an error saying “file busy.”

I think this may have something to do with using either the Finder or Quark to open each file in the dropped group but I can’t seem to figure it out. The script follows.

Also, does anyone know how AS chooses the order of which items to process when a group of items is drag and dropped? I assumed it would be alpha order but it doesn’t seem so. Is it possible to set that so it processes the file in alpah order or date order in the same way that you would specify the view order in a finder window?


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

I’m not sure why your last file never gets processed… a neater way to do the repeat loop looks like this, however:


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Also, we had a thread about ordering dropped items a few weeks back. Here’s a link:
http://bbs.applescript.net/viewtopic.php?t=8446

Thanks. I didn’t know you could set up a repeat like that. Unfortunately, I’m still getting the “File some object is busy.” error. I think it’s got to be a some kind of Finder/Quark conflict. Maybe because I’m opeing the file with the finder and then processing and closing it in Quark, one of the two applications can’t use it and is telling me it’s busy. Who knows.