• 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: Finder Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder Question


  • Subject: Re: Finder Question
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 11 Jan 2017 15:39:22 -0600

On Jan 11, 2017, at 14:01, S. J. Cunningham <email@hidden> wrote:
Why does the first method work and the second fail?


Hey Steve,

Because?  :)

They seem equivalent to me.

Not really.

(Although I thought the same thing long ago.)

-- Method 1
tell application "Finder" to set urlList to URL of every item of someFolder

Talking to the folder and creating a list of Finder-References.

Quite appropriately.

Although Finder-References are generally useless and slow – it's faster and better to get as alias list.

tell application "Finder"
tell front window
set l to items as alias list
end tell
end tell

-- Method 2
tell application "Finder" to set fileList to every item of someFolder

Talking to the folder and creating a list of Finder-References.

tell application "Finder" to set urlList to URL of every item of fileList

THEN – talking to the list-object of Finder-References – NOT the Finder-Folder-Object.

You're not actually talking to the Finder anymore, although the Finder-Tell-Block is fooling you into thinking that you are.

Make more sense?

--
Best Regards,
Chris

 _______________________________________________
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: Finder Question
      • From: "S. J. Cunningham" <email@hidden>
References: 
 >Finder Question (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Finder Question
  • Next by Date: Re: Finder Question
  • Previous by thread: Finder Question
  • Next by thread: Re: Finder Question
  • Index(es):
    • Date
    • Thread