• 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: Two things I noticed in a simple Finder script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two things I noticed in a simple Finder script


  • Subject: Re: Two things I noticed in a simple Finder script
  • From: Paul Berkowitz <email@hidden>
  • Date: Sat, 02 Jun 2001 14:07:28 -0700

On 6/2/01 8:47 AM, "Jan Pieter Kunst" <email@hidden> wrote:



> 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 = {}

Use a try block:

set x to container window of folder ...
set y to container windows -- gives {} if there are no open windows
try
if y contains x then ...
on error -- if you want to
beep
display dialog "Sorry. There are no open windows."
end try



I don't know if there's a solution to the popup windows tab positioning,
sorry.

--
Paul Berkowitz


  • Follow-Ups:
    • Re: Two things I noticed in a simple Finder script
      • From: Andy Wylie <email@hidden>
    • Re: Two things I noticed in a simple Finder script
      • From: Jan Pieter Kunst <email@hidden>
References: 
 >Two things I noticed in a simple Finder script (From: Jan Pieter Kunst <email@hidden>)

  • Prev by Date: Re: Entourage: make new contact
  • Next by Date: Re: Two things I noticed in a simple Finder script
  • Previous by thread: Two things I noticed in a simple Finder script
  • Next by thread: Re: Two things I noticed in a simple Finder script
  • Index(es):
    • Date
    • Thread