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: Jay Louvion <email@hidden>
- Date: Thu, 15 Sep 2005 14:45:17 +0200
le 15/09/05 11:21, Kumar Shailove à email@hidden est réputé(e) avoir
écrit :
> 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 ?
>
>
> Thanks in Advance
> Kumar Shailove.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> e.com
>
> This email sent to email@hidden
I would try calling on the name of the window that announces the current
emptying of the trash to do the handling of the conditionnal; I just don't
know what it's name is, I'll let you find it out.
Tell application "Finder"
Empty trash
repeat -- this repeat wait for empty trash window to go away
delay 1
set window_names to name of windows
if "Emptying trash" is not in window_names then exit repeat
end repeat
Display dialog "abc"
End tell
HTH
J.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
_______________________________________________
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