• 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
reading a file >32Kb
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reading a file >32Kb


  • Subject: reading a file >32Kb
  • From: James Burns <email@hidden>
  • Date: Thu, 13 Mar 2003 14:23:56 -0500

Hello:

I'm experiencing a weird problem, and I'm wondering if it's a bug (or a weird throwback to the old 32kb text limit).

What I'm doing is:

1/ Reading a text file.
2/ Testing if it contains a string
3/ If so, do some stuff, otherwise, pop up a dialog.

The weird thing is that I can see that the file contains the string, but fails the test. Then I noticed that the file is 42K and I thought,
"Don't tell me that I can't read a file larger than 32Kb into a variable!!"

Here's the handler. Note that sceneTemp is assigned elsewhere, and that I'm doing a little dance with variables to make sure I don't overwrite certain variables until I test that they are valid:

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

on openScene() -- pick scene file
log "Started OpenScene handler"
try
set temp to read file (sceneTemp)
if temp contains "SaveRGBImagesPrefix" then -- and my >32Kb file DOES contain this...
set output to temp
set sceneFile to sceneTemp
set {RGBname, oldFormat} to extractStuff(output, {"SaveRGBImagesPrefix", "RGBImageSaver"})
return true
else
display dialog "Sorry. The output options don't appear to be set correctly for this file." buttons {"Oops!"} default button 1
return false
end if
on error what -- there is no scene file
display dialog "Please choose a scene to render." buttons {"Cancel", "OK"} default button 2
if the button returned of result is "OK" then
getScene()
return false
else
return false
end if
end try
end openScene

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

Please tell me I'm just making a newbie mistake, or please, please tell me the way to work around this...


Thanks in advance,


-----
James Burns
http://www.jamesburnsdesign.com
_______________________________________________
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.

  • Follow-Ups:
    • Re: reading a file >32Kb
      • From: Shane Stanley <email@hidden>
    • Re: reading a file >32Kb
      • From: Helmut Fuchs <email@hidden>
  • Prev by Date: Running a script from Mail.app
  • Next by Date: Re: scripting mail to select mailboxes
  • Previous by thread: Re: Running a script from Mail.app
  • Next by thread: Re: reading a file >32Kb
  • Index(es):
    • Date
    • Thread