reading a file >32Kb
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.