Re: How to deal with Asynchronous Finder operations
Re: How to deal with Asynchronous Finder operations
- Subject: Re: How to deal with Asynchronous Finder operations
- From: Matt Neuburg <email@hidden>
- Date: Fri, 16 Sep 2005 08:34:00 -0700
On Thu, 15 Sep 2005 10:42:59 -0700, Andrew Oliver <email@hidden> said:
>On 9/15/05 2:21 AM, "Kumar Shailove" <email@hidden> wrote:
>
>> Hi list,
>>
>> Finder operations are asynchronous, i.e. if I execute the following
>> script -
>>
>> tell application "Finder"
>> empty trash
>> display dialog "abc"
>> end tell
>>
>> If the Trash is taking, say, 5 minutes to become empty, the dialog is
>> displayed and the script execution completes. I want to wait until the
>> statement in the first line has been executed (or more precisely I
>> should say, the operation corresponding to this statement should be
>> completed) and then only the script should proceed with the next
>> statement(s). Any ideas ?
>
>Use the standard Applescript 'ignoring application responses':
>
>ignoring application responses
> tell application "Finder"
> empty trash
> end tell
>end ignoring
>display dialog "ABC"
>
>Since you're ignoring the response of the Finder's empty trash command, the
>rest of the script is free to proceed.
That's the exact opposite of what Kumar said he wanted to do. He said he
*wanted* to wait until the trash is empty.
One possibility (I have not tried this) might be to loop with a delay and
see whether the trash is in fact empty yet...? m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden