Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why the Finder froze!!



I had a problem with a small script.
The script was like this:

tell app "Finder"

do some stuff

do some more stuff

now do a 'do shell script'

end tell

The problem was that when I did the 'do shell script' it was WITHIN a Finder app block. As soon as the shell script started, the UNIX command blocked the Finder. So, the Applescript script file itself was blocked while the UNIX commaand was running as well as all of my Finder windows.

The solution is to remove the 'do shell script' command from within the Finder block. I did this by making a subroutine called myDoShellCmd which is placed OUTSIDE of the tell app "Finder" block.

This is a great lesson about the scope of a block. The Finder is not active in a local subroutine called from within a tell app "Finder" block. The subroutine must also have a tell app "Finder" block.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.