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

Re: text to list


  • Subject: Re: text to list
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Mon, 2 Dec 2002 18:03:38 +1100

On 12/1/02 9:20 AM, "Michelle Steiner" <email@hidden> wrote:

If you're trying to remove the zeros, then it's just a bit more complex:

set text item delimiters to {"0"}
set foo to text items of "102030405060708090"
set text item delimiters to {""}
foo
--> {"1", "2", "3", "4", "5", "6", "7", "8", "9", ""}

A little touch up is necessary to remove that final empty string,
caused by that final zero.

set theString to "102030405060708090000"



if the list is really that regular you can use a repeat loop and if it's large you can use Serge's script object method.

set old_string to "102030304050606070809010203040506070809"
-- or a very long string
script _quick
global old_string
property fast_string : old_string
property new_list : {}
end script
repeat with i from 1 to (count _quick's fast_string) by 2
set end of _quick's new_list to item i of _quick's fast_string
end repeat
return _quick's new_list


--
--
Malcolm Fitzgerald email@hidden
Database Manager http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
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: text to list (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Finding a volume name
  • Next by Date: Re: Finding a volume name
  • Previous by thread: Re: text to list
  • Next by thread: OS X Folder Actions
  • Index(es):
    • Date
    • Thread