why the Finder froze!!
why the Finder froze!!
- Subject: why the Finder froze!!
- From: Richard Covert <email@hidden>
- Date: Fri, 30 Apr 2004 03:07:41 -0500
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.