• 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: trying to make a list of numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying to make a list of numbers


  • Subject: Re: trying to make a list of numbers
  • From: David Andrews <email@hidden>
  • Date: Thu, 8 Jul 2004 22:53:14 -0400

Words are words, you want numbers. Try this:

set unixLine to ASCII character 10
set macLine to ASCII character 13 -- just for testing
set theText to "30.14
-0.25
-0.82
30.13
30.68
29.95
19.13
34.19" as string -- or Unicode text
set theList to {""}
set AppleScript's text item delimiters to unixLine -- works
--set AppleScript's text item delimiters to macLine -- don't work
--set AppleScript's text item delimiters to return -- don't work
set theList to text items of theText
set AppleScript's text item delimiters to {""}
theList

--> {"30.14", "-0.25", "-0.82", "30.13", "30.68", "29.95", "19.13", "34.19"}


On Jul 8, 2004, at 10:06 PM, Richard Allaway wrote:

Persons of the applescript list,

I'm new to this applescript business. Could anyone explain this to me?

set theText to "30.14
-0.25
-0.82
30.13
30.68
29.95
19.13
34.19" as Unicode text
log every word of theText

-- (*30.14, 30.13, 30.68, 29.95, 19.13, 34.19*)

set theText to "30.14
-0.25
-0.82
30.13
30.68
29.95
19.13
34.19" as string
log every word of theText

-- (*30.14, 0.25, 0.82, 30.13, 30.68, 29.95, 19.13, 34.19*)

Obviously, I like the second version better, but those minus signs are kinda important. What should I do to get a list of all the numbers?

Please help!
Thanks

Richard
_______________________________________________
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.
_______________________________________________
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: 
 >trying to make a list of numbers (From: Richard Allaway <email@hidden>)

  • Prev by Date: Re: trying to make a list of numbers
  • Next by Date: Re: Keep a launched app in background
  • Previous by thread: Re: trying to make a list of numbers
  • Next by thread: Re: trying to make a list of numbers
  • Index(es):
    • Date
    • Thread