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 10:50:47 -0500
Ok... got the script working.
One version with Akua sweet's that I can't get to run correctly due to
syntax problems. The other using the "Kill Resource Fork" plugin
The problem now is that it runs into an "out of memory" error when it
get's to a certain point. At first I thought it was the size of the
file (200k) but then I looked again and it had processed a few 256k
files right before it errored out. here is the script that works except
for above problem -
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 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
------- End Script ------
It's setup as a droplet. I took the suggestions from the list and also
a different script I found before that just converted the text.
What is wrong with it?
sim
Also - if anyone want's to comment on the best way to parse subfolders
with this script I'd be most gratefull.
_______________________________________________
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.