• 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
Problem with folder searching script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with folder searching script


  • Subject: Problem with folder searching script
  • From: John Goodchild <email@hidden>
  • Date: 21 Oct 2004 14:33:05 -0700

Hello.

I am trying to write a script that searches the contents of a set of folders. When the script finds a folder, it processes the contents of that folder etc, etc.

I am having difficulty parsing the new folder name. The script stops with the error message "Expected a reference". Below is the basic form of the script:



on open theFolder
	parseFolder(theFolder)
end open

on parseFolder(aFolder)
	tell application "Finder"
		set theNumItems to number of items in aFolder
	end tell
	repeat with i from 1 to theNumItems
		tell application "Finder"
			set anItem to item i of aFolder
			if kind of anItem = "Folder" then
				set contProc to true
			else
				set contProc to false
			end if
		end tell
		if contProc then
			parseFolder(anItem) -- gives error "Expected a reference"
		end if
	end repeat
end parseFolder



Any help with this problem would be greatly appreciated. I am using Script Editor 2.0 (v43) and AppleScript 1.9.3 running in Mac OS X 10.3.5.

Regards,
John


 _______________________________________________
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: Problem with folder searching script
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Fraction Maker
  • Next by Date: Re: file extension
  • Previous by thread: Re: Fraction Maker
  • Next by thread: Re: Problem with folder searching script
  • Index(es):
    • Date
    • Thread