Coercion from string to integer fails
Coercion from string to integer fails
- Subject: Coercion from string to integer fails
- From: Dan Doughtie <email@hidden>
- Date: Thu, 31 May 2007 16:52:10 -0400
- Thread-topic: Coercion from string to integer fails
I have a script that reads in a preference from a text file.
The preference is basically the number of seconds since midnight.
I read the number from the file as text which makes it string.
I try to force it to an integer so I can do some math.
No matter what I do it fails and says it can¹t make ³49900² into type
integer. (49000 being the text from the file).
This set statement falls within a Tell Finder.
This is the part of the script that fails
open for access file MyPrefsFile
set myFolderToWatch to read file MyPrefsFile before "
"
set MyPrefsFolder to myFolderToWatch
set myCharCount to count of MyPrefsFolder
set MyPrefsInfo to read file MyPrefsFile from myCharCount + 2 to eof
set myTimeToRun to MyPrefsInfo
close access file MyPrefsFile
set myTimeToRun to myTimeToRun as integer
All this script does is monitors a folder and if it finds something during a
time period it will use CURL to FTP a file in a monitored folder.
Anyone know of a smoking gun?
Dan
--
Dan Doughtie
Augusta
_______________________________________________
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