• 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: Coercing document list to alias list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coercing document list to alias list


  • Subject: Re: Coercing document list to alias list
  • From: has <email@hidden>
  • Date: Tue, 12 Dec 2006 18:55:13 +0000

Mahlon Lovett wrote:

Hmmmm... doesn't work for me

tell application "Finder"
    get the selection -- a selection of docs, images, whatever
    tell (result)
        if (count) = 1 then
            set the_list to {it as alias}
        else
            set the_list to it as alias list
        end if
    end tell
    --> return the_list
end tell

I still get a bunch of system file references rather than an alias list...

That's because you're operating on an AppleScript value, not the application object model. e.g. Compare:


tell application "Finder"
set some_reference to a reference to items of home whose name starts with "d"
tell some_reference
if (count) = 1 then
set the_list to {it as alias}
else
set the_list to it as alias list
end if
end tell
--> return the_list
end tell


has
--
http://freespace.virgin.net/hamish.sanderson/
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org


_______________________________________________ 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
  • Prev by Date: Re: rm does not always remove immediately
  • Next by Date: Re: Problem with AppleScript
  • Previous by thread: Re: Coercing document list to alias list
  • Next by thread: Re: Coercing document list to alias list
  • Index(es):
    • Date
    • Thread