• 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
Coercion from string to integer fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Coercion from string to integer fails
      • From: Emmanuel <email@hidden>
    • Re: Coercion from string to integer fails
      • From: "Gary (Lists)" <email@hidden>
  • Prev by Date: Script to select firefox menu item on startup
  • Next by Date: RE: How to automatically acknowledge a dialog
  • Previous by thread: Re: Script to select firefox menu item on startup
  • Next by thread: Re: Coercion from string to integer fails
  • Index(es):
    • Date
    • Thread