Re: Anybody knows (Deivy Petrescu)
Re: Anybody knows (Deivy Petrescu)
- Subject: Re: Anybody knows (Deivy Petrescu)
- From: "Stockly, Ed" <email@hidden>
- Date: Fri, 27 Jul 2001 22:26:51 -0700
>
> > tell application "Finder" to count items of "desktop folder"
>
>
> >He answers 14, but that's 61 files and folders and aliases....
>
>
>The part I like is that there *are* 14 items in "desktop folder",
>
>but they are characters. ;)
>
>>>though I would like to know why you bit of code gets a count of 14 on my mac too.
Well, as Jon so nicely pointed out if you look closely at the snippet you'd see it's counting the items the string "desktop folder" and there are 14 characters in that string on any mac.
>>>>I maybe wrong but I don9t think that the desktop is really a folder--at any
>
rate this bit of code counts all the items on my desktop--
>
You are not wrong at all... the desktop is a funny kind of transcendental finder object that is made up of the contents of the desktop folder of every locally mounted volume as well as the icons for all mounted volumes and the trash. It's also a bit buggy when working with it in appleScript. You'll find that references to the desktop folder for a particular volume can get coerced to a reference to the desktop or to the desktop folder of the startup volume. I find it takes a lot of trial and a lot of error to successfully script the desktop.
HTH,
ES