• 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
count of Finder windows: Is this a bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

count of Finder windows: Is this a bug?


  • Subject: count of Finder windows: Is this a bug?
  • From: Gil Dawson <email@hidden>
  • Date: Thu, 18 Nov 2010 12:04:13 -0800

Thanks to Jim Matthews of FetchSoftWorks for helping me isolate this one.

This script:

tell application "Finder"
log "count of Finder windows=" & (count of Finder windows)
repeat with w in Finder windows
log "name of w=" & name of w
end repeat
end tell

Produces nonsense in the log:

(*count of Finder windows=3*)
(*name of w=ASEDitor Recordings.scptFourth & Pyratania.png*)
(*name of w=BU G3 15GBAppleScript Editor.appGalveston5Nov2010 1.png*)
(*name of w=BU MBProHD 306GBBackUpAndReplaceSection.scptVegasRodeo.JPG*)
(*name of w=MBProHDBlanken->iCalMCCVin.appTehachapi Loop*)
(*name of w=Scratch 120Old stuffWaveland.png*)

Result: error

"Can’t make name of item 6 of every «class brow» of application \"Finder\" into type Unicode text." number -1700 from name of item 6 of every «class brow» to Unicode text

1) It's the names of a scrambled list of some items, but not windows.
2) Item 6? There are only 3 Finder windows open.
(*count of Finder windows=3*)


However, this script:

tell application "Finder"
log "count of Finder windows=" & (count of Finder windows)
set fws to Finder windows
repeat with w in fws
log "name of w=" & name of w
end repeat
end tell

Produces what I expected:

count of Finder windows=3
name of w=MBPro
name of w=AppleScripts
name of w=2010

So, is this a bug or some nuance of syntax that I have missed?

--Gil

 _______________________________________________
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

  • Follow-Ups:
    • Re: count of Finder windows: Is this a bug?
      • From: Axel Luttgens <email@hidden>
    • Re: count of Finder windows: Is this a bug?
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: problem with list
  • Next by Date: Re: count of Finder windows: Is this a bug?
  • Previous by thread: Re: say command
  • Next by thread: Re: count of Finder windows: Is this a bug?
  • Index(es):
    • Date
    • Thread