Re: Two things I noticed in a simple Finder script
Re: Two things I noticed in a simple Finder script
- Subject: Re: Two things I noticed in a simple Finder script
- From: Jan Pieter Kunst <email@hidden>
- Date: Sun, 03 Jun 2001 13:30:22 +0200
Nigel Garvey (email@hidden) schreef op 03-06-2001 12:50 :
>
Jan Pieter Kunst wrote on Sat, 02 Jun 2001 17:47:01 +0200:
>
>
> Another thing I noticed is that if there are no windows open, I can't use
>
> Applescript to check if a certain window is open without getting into some
>
> infinite loop. In other words, this:
>
>
>
>
>
> set x to container window of folder ...
>
> set y to container windows -- gives {} if there are no open windows
>
> if y contains x then ... -- script gets stuck in an infinite loop if y = {}
>
>
set x to container window of folder ...
>
if x exists then ...
>
>
NG
That's it. Beautiful! 21 lines of code replaced by 5 lines, much faster
execution. Thank you very much!
JP