• 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: alias list error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alias list error


  • Subject: Re: alias list error
  • From: kai <email@hidden>
  • Date: Sat, 31 Mar 2007 00:25:42 +0100


On 30 Mar 2007, at 23:56, Jim Brandt wrote:

Can someone explain how I can fix this statement so that it works every time.
Right now, it works if there are two or files in the folder, but fails if only a
single file exists.

This is a known issue, Jim.

You could either use a try block, as suggested by Shane, or count the matching items and coerce as appropriate:

---------------

set hold_folder to choose folder

tell application "Finder"
	tell (every item of folder hold_folder whose kind is not "folder")
		if (count) is 1 then
			set theList to it as alias as list
		else
			set theList to it as alias list
		end if
	end tell
end tell

---------------

---
kai


_______________________________________________ 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
References: 
 >alias list error (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: alias list error
  • Next by Date: Re: alias list error
  • Previous by thread: Re: alias list error
  • Next by thread: Re: alias list error
  • Index(es):
    • Date
    • Thread