• 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: Tell Statement Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tell Statement Problem


  • Subject: Re: Tell Statement Problem
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 28 Jan 2006 01:37:10 -0700

On Jan 28, 2006, at 1:04 AM, Bastard Child wrote:

I've got some code here that doesn't appear to be working, and I can't
figure out why. The closest thing I can come up with, is that the
"tell" statement doesn't like the "theFolder" variable. Whenever I run
the code in the Script Editor, I draw the following error:

Finder got an error: Expected a reference.

Here's the code:

-----
set theFolder to choose folder

parseFolder(theFolder)

on parseFolder(aFolder)
	tell application "Finder"
		set theNumItems to number of items in aFolder
	end tell
end parseFolder
-----

Any ideas?

You need "count", not "number" This syntax works:

set theItems to items of aFolder
set theNumItems to count theItems

So does this, even though it doesn't seem to make sense

set theNumItems to count item aFolder

-- Michelle

-- "To occupy Iraq would instantly shatter our coalition, turning the whole Arab world against us and make a broken tyrant into a latter- day hero ... assigning young soldiers to a fruitless hunt for a securely entrenched dictator and condemning them to fight in what would be an un-winnable urban guerilla war. It could only plunge that part of the world into even greater instability."
- George H.W. Bush


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Tell Statement Problem
      • From: Christopher Nebel <email@hidden>
    • Re: Tell Statement Problem
      • From: Bastard Child <email@hidden>
References: 
 >Tell Statement Problem (From: Bastard Child <email@hidden>)

  • Prev by Date: Re: Tell Statement Problem
  • Next by Date: Re: Tell Statement Problem
  • Previous by thread: Re: choose folder (was: Tell Statement Problem)
  • Next by thread: Re: Tell Statement Problem
  • Index(es):
    • Date
    • Thread