• 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: Is finder brain dead?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Is finder brain dead?
      • From: Alex Zavatone <email@hidden>
References: 
 >Is finder brain dead? (From: Robert Poland <email@hidden>)
 >Re: Is finder brain dead? (From: Luther Fuller <email@hidden>)
 >Re: Is finder brain dead? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Random Signatures with Mail
  • Next by Date: Re: Is finder brain dead?
  • Previous by thread: Re: Is finder brain dead?
  • Next by thread: Re: Is finder brain dead?
  • Index(es):
    • Date
    • Thread