• 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: Removing resource fork via applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Removing resource fork via applescript?
      • From: Chris Espinosa <email@hidden>
References: 
 >Removing resource fork via applescript? (From: Stephen Jonke <email@hidden>)

  • Prev by Date: Re: Why is it
  • Next by Date: Re: [OT]: Why is it
  • Previous by thread: Re: Removing resource fork via applescript?
  • Next by thread: Re: Removing resource fork via applescript?
  • Index(es):
    • Date
    • Thread