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, 09 Feb 2010 21:59:58 -0500
On 09/02/2010, at 20:21 , Alex Zavatone wrote:
> Yeah. I mean a list. I just looked at the coercion types and sadly, every item does not work for this.
>
> I was doing this so I could get a bunch of files and of those files, only get the PNG ones. I ended up walking the list and using "ends with" instead of trying to get "the name extension" and everything worked.
>
> Thanks.
>
> On Feb 9, 2010, at 6:41 PM, Stockly, Ed wrote:
>
>> When you say ‘array’ do you mean a list?
>>
>> {item, item, item}
>>
>> An ‘alias’ in appleScript is simply a reference to a file.
>>
>> Do you want to create an ‘alias file’ to the file referenced by each alias in a list?
>>
>> If so:
>> Set someItems to {}
>> Repeat with thisItem in folderList
>> Set the end of someItems to make new alias file at desktop to thisItem
>> End repeat
>>>
>>> the “every item of “ construct doesn’t work on lists.
>>>
>>>
>>> HTH,
>>>
>>> ES
>
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
_______________________________________________
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