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

Re: reading a file >32Kb


  • Subject: Re: reading a file >32Kb
  • From: James Burns <email@hidden>
  • Date: Thu, 13 Mar 2003 16:03:51 -0500

On Thursday, March 13, 2003, at 03:08 PM, Helmut Fuchs wrote:

AppleScript still seems not to be able to handle strings larger than 32Kb correctly. You should be fine if you fall back to using text item delimiters though (but be aware they are case sensitive!).

This is a disappointment. Any thoughts on whether this will be changed? It's MUCH easier to search to a string in an arbitrarily large container, rather than have to do this sort of dance...

Is it that the "read" command that doesn't deal with >32MB files, or is it that variables can't hold more than 32Mb? In either case, how can I deal with having to hold (and search for stuff, even using delimiters) a large file in a variable?


Something along these lines should work:

set saveTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to "SaveRGBImagesPrefix"
set containsIt to (count temp's text items > 1)
set AppleScript's text item delimiters to saveTIDs
if containsIt then

HTH,

Helmut


Thanks, Helmut.

On testing, I found that this will only work with another set of parentheses, but you set me on the right track.

Here's what I ended up using:

on openScene() -- pick scene file
log "Started OpenScene handler"
try
set temp to read file (sceneTemp)
set AppleScript's text item delimiters to "SaveRGBImagesPrefix"
set SetToRender to ((count temp's text items) > 1) as boolean
set AppleScript's text item delimiters to oldDelims
if SetToRender then
set output to temp
set sceneFile to sceneTemp
set {RGBname, oldFormat} to extractStuff(output, {"SaveRGBImagesPrefix", "RGBImageSaver"})
return true
else
log "Failed Check for SaveRGBImagesPrefix"
display dialog "Sorry. The output options don't appear to be set correctly for " & sceneTemp & ". " 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. " & what 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

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

Thanks again.

----
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: Helmut Fuchs <email@hidden>
References: 
 >Re: reading a file >32Kb (From: Helmut Fuchs <email@hidden>)

  • Prev by Date: Re: scripting mail to select mailboxes
  • Next by Date: Re: reading a file >32Kb
  • Previous by thread: Re: reading a file >32Kb
  • Next by thread: Re: reading a file >32Kb
  • Index(es):
    • Date
    • Thread