• 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
List acting like a global
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

List acting like a global


  • Subject: List acting like a global
  • From: Jason Bourque <email@hidden>
  • Date: Wed, 05 Dec 2001 09:56:44 -0500

Hello,

What's Happening?

tell application "Finder"
set aList to name of every item of desktop
end tell

tell me to srListIndexer(aList)



-- sr2ndListItemFromIndexOf1stList
set vItemWithIndex to "3 Paper Alligator"

-- Capture the current delimiter for AppleScript
set vTids to the AppleScript's text item delimiters
set the AppleScript's text item delimiters to " "

set vItemIndex to (item 1 of text items of vItemWithIndex) as number

-- Reset the delimiter for AppleScript to its previous call state
set AppleScript's text item delimiters to vTids

item vItemIndex of aList
--> "3 Paper Alligator"

-- Should be "Paper Alligator"
-- What's happening?

on srListIndexer(vAnyList)

-- Capture the current delimiter for AppleScript
set vTids to the AppleScript's text item delimiters
set the AppleScript's text item delimiters to ""

repeat with vNth from 1 to count of vAnyList
set vListItemNth to item vNth of vAnyList
set item vNth of vAnyList to (vNth & " " & vListItemNth as text)
end repeat

-- Reset the delimiter for AppleScript to its previous call state
set AppleScript's text item delimiters to vTids

-- Return needed value
vAnyList

end srListIndexer


References: 
 >Re: Wrapping lines (From: garbanzito <email@hidden>)

  • Prev by Date: Finder out of memory mystery...
  • Next by Date: RE: interesting discovery (trying to get record labels as strings )
  • Previous by thread: Re: Wrapping lines
  • Next by thread: Re: Wrapping lines
  • Index(es):
    • Date
    • Thread