• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to deal with Asynchronous Finder operations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to deal with Asynchronous Finder operations (From: "Kumar Shailove" <email@hidden>)

  • Prev by Date: Re: Converting Mac Roman and/or UTF 16 to UTF 8?
  • Next by Date: Re: don't understand how to use timeout
  • Previous by thread: How to deal with Asynchronous Finder operations
  • Next by thread: Re: How to deal with Asynchronous Finder operations
  • Index(es):
    • Date
    • Thread