Re: Removing resource fork via applescript?
Re: Removing resource fork via applescript?
- Subject: Re: Removing resource fork via applescript?
- From: Doug McNutt <email@hidden>
- Date: Sat, 1 Jan 2005 10:47:31 -0700
At 03:13 -0500 1/1/05, Stephen Jonke wrote:
>Is it possible via an applescript to strip the resource fork from files? Either directly in applescript, or via command-line (and thus doable via applescript)?
You could take advantage of the fact that the UNIX cp command doesn't copy the resource fork.
Change the file name with mv
do shell script 'mv thefile oldfile'
Copy the file with cp
do shell script 'cp oldfile thefile'
Remove the detritus
do shell script 'rm oldfile'
I'm quite sure that rm does not leave the resource around but I last checked in 10.2. You will probably need to call out full pathnames because the working directory will not be preserved over the do shell calls.
You might also be able to remove just the resource fork with
do shell script 'rm thefile/..namedfork/rsrc' (That's two periods in a row.)
but be very careful. I haven't tried it.
thefile/..namedfork/data
would be the complete reference to the corresponding data fork. The slashes are not directory separators. They are an Apple way to support forks under BSD UNIX.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden