• 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: Strange Finder behaviour...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Finder behaviour...


  • Subject: Re: Strange Finder behaviour...
  • From: Peter Baxter <email@hidden>
  • Date: Thu, 19 Jun 2008 03:24:41 +1000

The behaviour may seem strange David, however once you realise that your definition aWindow only refers to the items in Window1name, you will realise your mistake.  The script below works:

tell application "Finder"
activate
set Window1Name to name of window 1
display dialog Window1Name
end tell

So the part of your script with a fault is this part:

repeat with aWindow in every window
display dialog ">" & name of aWindow as string
end repeat

If you look carefully, you will realise that aWindow has not been defined as a window so the script will find all the items in every window in the finder.

2.  If there is no window or your loop runs out of further windows, then you will need an error catcher in your script.  Perhaps you could try this: 
tell application "Finder"
open window 1  --  this avoids the problem that finder may not be the active application when you run the script
set Window1Name to name of window 1  -- This is not necessary, but you had it so I left it in.  Your script does not use the result.
repeat with aWindow in every window
try
display dialog ">" & name of aWindow as string  -- items in window 1 
on error
display dialog "That's all folks!" --
exit repeat
end try
end repeat
end tell
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Strange Finder behaviour... (From: David Crowe <email@hidden>)

  • Prev by Date: Re. Strange Finder behaviour...
  • Next by Date: Re: Strange Finder behaviour...
  • Previous by thread: Strange Finder behaviour...
  • Next by thread: Re: Strange Finder behaviour...
  • Index(es):
    • Date
    • Thread