• 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
applescript & TextEdit : selecting minus sign (-) for type conversion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

applescript & TextEdit : selecting minus sign (-) for type conversion?


  • Subject: applescript & TextEdit : selecting minus sign (-) for type conversion?
  • From: Laura Burns <email@hidden>
  • Date: Fri, 17 Apr 2009 10:01:04 +0100

Hi everyone , my first post :
I have a text file with a large quantity of real numbers , both positive and negative
and want to write an applescript to get TextEdit to  round them to integers. (then rewrite a copy file - this i can do)

** but I'm losing the minus sign information **!!


using this code:
------------------------------------------------------------------------
tell application "TextEdit"
             --file is open already
         set the_doc_text to text of the front document
end tell

     -- loop through lots of values with integer count W.....

set the_word to word W of the_doc_text
set the_int to the_word as integer

     -- and write the_int  etc.

------------------------------------------------------------------------

if i have as a text file :

37.147   -4.041    -3.4591   10.805    -0.439    -1.733
i get:

37            4            3            10             0            1

------------------------------------------------------------------------
the minus sign is not selected by the "word" applescript command-

how can i get those signs back in my  output ?


thanks in advance

Laura

email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: applescript & TextEdit : selecting minus sign (-) for type conversion?
      • From: CYB <email@hidden>
    • Re: applescript & TextEdit : selecting minus sign (-) for type conversion?
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Selecting files of type zip
  • Next by Date: Re: Simply deleting a fil
  • Previous by thread: Re: Photomerge
  • Next by thread: Re: applescript & TextEdit : selecting minus sign (-) for type conversion?
  • Index(es):
    • Date
    • Thread