Re: Is finder brain dead?
Re: Is finder brain dead?
- Subject: Re: Is finder brain dead?
- From: Deivy Petrescu <email@hidden>
- Date: Thu, 08 Dec 2011 19:34:50 -0500
On Dec 8, 2011, at 14:55 , Robert Poland wrote:
> Thanks Luther,
>
> Seems like I've been here before. List caught me again.
>
>
> On Dec 8, 2011, at 12:48 PM, Luther Fuller wrote:
>
>> On Dec 8, 2011, at 12:21 PM, Robert Poland wrote:
>>
>>> I have a script that uses the following;
>>>
>>> tell application "Finder"
>>> delay 10
>>> set selected_Item to selection
>>> delay 10
>>> display dialog "" & selected_Item
>>> end tell
>>>
>>>
>>> If I open, for example, the Applications folder and select any item then run the script "selected_Item" is empty. If I run the script again all is well.
>>
>> That's because selected_Item is a list.
>> This WILL work ...
>>
>> tell application "Finder"
>> set selList to selection
>> if (count items of selList) ≠ 1 then return
>> set selItem to (item 1 of selList) as alias
>> display dialog selItem as text
>> end tell
>
> Robert Poland - Fort Collins, CO
The point that select_item is a list does not really explain the problem.
Apparently there is really a problem with "Finder's list".
That is because selection_item is a Finder list it does not return the "files".
Remember that because you use (""& selection_item), you are coercing the list to text.
However, if you rewrite your script using
tell application "Finder"
delay 1
set selected_Item to selection as alias list
delay 1
display dialog "" & selected_Item
end tell
you will get your dialog.
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