Re: Reading contents of a clipping file?
Re: Reading contents of a clipping file?
- Subject: Re: Reading contents of a clipping file?
- From: "Steven D.Majewski" <email@hidden>
- Date: Fri, 12 Nov 2004 12:26:24 -0500
On Nov 12, 2004, at 7:45 AM, Rob Jorgensen wrote:
At 11:06 AM +0100 11/12/04, Emmanuel wrote:
At 8:05 AM +0100 11/12/04, Richard Rönnbäck wrote:
Is there any way to read the text of a clipping file?
Yes.
Is it stored in the resource fork ?
Yes.
If so, how do one read the resource
part?
One installs the Satimage osax.
Extra Suites (not free but reasonably priced) also reads resource
files. Both do a fine job.
On OSX, you can also do it with Python using the Carbon.Res module.
Example script below. If you wanted to call it from 'do shell script',
you could skip the arg processing and trim it down to a couple of lines
-- Steve Majewski
#!/usr/bin/python
from Carbon import Res
import sys
def getclipping( name ):
Res.FSOpenResFile( name, 0 )
return dict([ (t,Res.GetIndResource( t,1 ).data) for t in (
'url ',
'urln', 'TEXT'
) ])
if __name__ == '__main__' :
for name in sys.argv[1:]: # for each file pathname in arglist
print name
for k,r in getclipping( name ).items(): print '
-',k,':',r
-- Steve Majewski - University of Virginia Alderman Library
_______________________________________________
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