Re: stripping resource forks from a file.
Re: stripping resource forks from a file.
- Subject: Re: stripping resource forks from a file.
- From: Simeon Johnston <email@hidden>
- Date: Mon, 12 Aug 2002 12:01:01 -0500
Now I'm sure I'm running into a file size limit in AppleScript.
The limit seems to be around 200k. Is that a built in limit? Is there
a way around it?
Below is the NEW and IMPROVED script (sorta) with changes comented out.
Now it fales on (set txtList to every text item of openFile) because it
can't read the entire file (can't get every text item of 546 - or some
other random number).
sim
Simeon Johnston wrote:
> on open (allthefile)
> repeat with theFile in allthefile
> set theInfo to info for theFile
> set fileName to name of theInfo
> if fileName ends with ".kd" then
> tell application "Finder"
> set locked of theFile to false
> end tell
> try
> set openFile to (open for access theFile with write permission)
> -- set theTxt to (read openFile)
> set oldDelims to AppleScript's text item delimiters
> set AppleScript's text item delimiters to (ASCII character 13)
> -- set txtList to every text item of theTxt
> set txtList to every text item of openFile
> set AppleScript's text item delimiters to (ASCII character 10)
> set theTxt to txtList as string
> set AppleScript's text item delimiters to oldDelims
> write theTxt to openFile
> close access openFile
> tell application "Finder"
> set file type of theFile to "ESKD"
> set creator type of theFile to "ESK2"
> end tell
> Kill Resource Fork theFile
> on error number -49
> close access openFile
> end try
> end if
> end repeat
> end open
_______________________________________________
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.