• 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: loop to build a list?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loop to build a list?


  • Subject: Re: loop to build a list?
  • From: James Burns <email@hidden>
  • Date: Mon, 17 Feb 2003 21:59:09 -0500

Thanks. This works now. I moved around a couple of things, but the method of setting the end of a defined list to a result is great.

Thanks again.

Here's what I came up with after reading your post:

---------------------------------
set oldDelims to AppleScript's text item delimiters
set theList to {}

set AppleScript's text item delimiters to "{" -- Check out lines of file
set i to text items of extContent -- for each line
repeat with foundString in i -- repeat loop, looking for searchWord
if foundString contains "ImageSaver" then
set AppleScript's text item delimiters to " "
set end of theList to (text item 8 of foundString)
end if
end repeat
log theList -- Show the contents of theList
set AppleScript's text item delimiters to oldDelims

On Monday, February 17, 2003, at 09:12 PM, email@hidden wrote:

Subject: Re: loop to build a list?
From: Duncan Cowan <email@hidden>
To: "email@hidden"
<email@hidden>

I believe that this should work

set theList to {} -- your list

set AppleScript's text item delimiters to "{" -- Check out lines of
file starting with open bracket
set i to text items of extContent -- for each line
repeat with foundString in i -- repeat loop
if foundString contains "ImageSaver" then -- further narrowing
selection
set AppleScript's text item delimiters to " " -- break into
"words"
set gotIt to {text item 8 of foundString}
log gotIt -- Here gotit has the value I want
end if

set end of theList to gotIt -- add item to end of list

end repeat
-----
James Burns
http://www.jamesburnsdesign.com
_______________________________________________
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.

  • Prev by Date: Re: Page breaks in Excel
  • Next by Date: Re: 'grep' question
  • Previous by thread: Re: loop to build a list?
  • Next by thread: Re: loop to build a list?
  • Index(es):
    • Date
    • Thread