• 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: Script to Get Finder Selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to Get Finder Selection?


  • Subject: Re: Script to Get Finder Selection?
  • From: Paul Skinner <email@hidden>
  • Date: Mon, 4 Aug 2003 10:30:54 -0400

On Monday, August 4, 2003, at 09:21 AM, John Delacour wrote:

At 7:50 am -0400 4/8/03, Paul Skinner wrote:

It is possible to alter a selection and break a script.

tell application "Finder"
repeat with i from 1 to (length of (get selection))
set ls to item i of (get selection)
delay 1
say (i as text)
end repeat
end tell

That's just plain stupid! And it has nothing to do with the point I was making. If you wanted to do what you're suggesting, you'd do it like this:


tell app "Finder"
set n to 0
repeat with i in (get selection)
set n to n + 1
say "" & n
end
end

-- JD

I agree. It is stupid.
It was one example of how you could create the conundrum of the user changing the selection while you operate on it.
I was trying to show that it's possible, not provide a nice code snippet.
Your explanation of why this won't happen in a repeat loop was accurate. Your claim that a user can't change the selection while you operate on it was inaccurate. I was simply setting the record straight.

PS
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Script to Get Finder Selection? (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Script to Get Finder Selection?
  • Next by Date: Type Text command
  • Previous by thread: Re: Script to Get Finder Selection?
  • Next by thread: Re: Script to Get Finder Selection?
  • Index(es):
    • Date
    • Thread