Finder crashes several Times if runnig AppleScript

hello!

when i run the follow script, the finder crashes sereval Times while the script is runnig … of course the script would stop then (when the finder crashes) and i have to reactivate the script again … and again … and again … why that? what’s false in this script that it crashes the Finder

Greetings from Switzerland!
sorry for my bad english! :wink:


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

Not sure what’s going up in your script, but these are my general rules for crashes and Finder:

  • Avoid, if possible the Finder. If you can use “do shell script” or standard additions, etc., use it.
  • If you can’t avoid the Finder, remove any thing from a tell Finder block which doesn’t need be targetted to the Finder. Eg:
tell app "Finder" to name of items of desktop
"x" is in result

Instead of:

tell app "Finder"
     name of items of desktop
     "x" is in result
end tell
  • Be careful with text-item-delimiters. The default value is {“”} (not “”, as in your script), but the safest method is remember the current value:
set prevTID to applescript's text item delimiters
set applescript's text item delimiters to "XXX"
--> do whatever here
set applescript's text item delimiters to prevTID
  • Remember: after using TIDs, restore the old TIDs allways.

Your script is too long for anyone to be able to just look at it and tell you what’s wrong.

It would help if you could narrow it down by giving some idea as to how far the script gets before the Finder crashes. For example, does it move any files? That would help identify a problem with the script vs. a problem with a specific file.

Additionally, try adding some log statements to the script. This will give you an idea of the flow of the program prior to the crash.