Re: Coercing document list to alias list
Re: Coercing document list to alias list
- Subject: Re: Coercing document list to alias list
- From: Mahlon Lovett <email@hidden>
- Date: Wed, 13 Dec 2006 09:14:16 -0500
- Thread-topic: Coercing document list to alias list
Here's where I'm puzzled:
Select one item in a folder in the Finder and script #1 returns an alias;
select more than one item and it returns a list in the form {document file
of "" of folder "", ...} -- not an alias list.
For my work, what this means is that, getting an alias list is easy if the
goal is operate on every item in a folder -- just use script #2. To operate
on a selection of items, it's necessary to use a repeat loop and build the
alias list 'by hand' -- i.e., the tedious way.
#1
tell application "Finder"
set sel to the selection
try
set x to (every item of sel) as alias list
on error
set x to {(first item of sel) as alias}
end try
end tell
#2 -- Yvan KOENIG
> tell application "Finder"
> set TheFolder to choose folder
> try
> set TheContent to (every file of TheFolder) as alias list
> on error (*
> Here when the folder contains a single file *)
> set TheContent to {(first file of TheFolder) as alias}
> end try
> end tell
Mahlon Lovett
Princeton NJ
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden