applescript & TextEdit : selecting minus sign (-) for type conversion?
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