Re: Tell Statement Problem
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