Re: Coercing an array of aliases to files
Re: Coercing an array of aliases to files
- Subject: Re: Coercing an array of aliases to files
- From: Deivy Petrescu <email@hidden>
- Date: Tue, 9 Feb 2010 23:35:52 -0500
On Feb 9, 2010, at 10:25 PM, Alex Zavatone wrote:
>
> On Feb 9, 2010, at 8:59 PM, Deivy Petrescu wrote:
>>
>> Alex,
>> if you post just few lines and do not explain what you want, it is going to be difficult to provide you with a good pointer.
>>
>> You probably wanted something like
>>
>> <script>
>> set afolder to path to "desk"
>> tell application "Finder" to set l to (every file of folder afolder whose name ends with ".png") as alias list
>> </script>
>>
>>
>> Deivy Petrescu
>> email@hidden
>
> Thanks Deivy. All I wanted to do was to see if there was a one line way of coercing an array (list) of aliases to an array of files. I thought that was explanatory enough.
>
> It turns out that you can't do that.
>
> In the end, this is what I ended up doing:
>
> set myItems to {}
> repeat with myItem in someItems
> set myNewItem to myItem as text
> set the end of myItems to myNewItem
> end repeat
Alex,
The list above is a list of strings.
When you say you want to coerce an array (list) of aliases to an array of files then either you can't, because an (Finder) alias is not technically a file, or, you do not need to because an alias could a file (or a folder, or a disk).
In my example above all the aliases are files.
Deivy Petrescu
email@hidden
_______________________________________________
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