Re: TIDs and other questions
Re: TIDs and other questions
- Subject: Re: TIDs and other questions
- From: John Delacour <email@hidden>
- Date: Fri, 25 Apr 2003 20:15:48 +0100
- Mac-eudora-version: 6.0a16
At 1:07 pm -0400 25/4/03, Deivy Petrescu wrote:
SQuestion:
Has anybody been able to "read", via AS, the contents of a clipping
file (the file that the Finder creates when text is dragged and
dropped on the desktop) ?
The only thing I get is eof error. This is it or is it possible to do it?
The text is in the resource fork of the file, so you need a tool to
read the resource. You have at least two options:
Drop a text clipping into your user folder, rename it
"a.textclipping" and run either of these:
-- 1. The Satimage osax that comes with Smile:
set fMac to "" & (path to "cusr") & "a.textclipping"
set n to "" & (list resources "TEXT" from file fMac)
load resource n type "TEXT" from file fMac
-- 2. DeRez, which you have if you installed the Developer tools:
set fMac to "" & (path to "cusr") & "a.textclipping"
set f to POSIX path of fMac
set pl to "@lines = `/Developer/Tools/./Derez " & f & " -only \"TEXT\"`;
for (@lines) {
/\\$\\\"/ and s~\\$\\\"(.+)\\\".+~$1~g
and s~\\s~~g or $_ = \"\" ;
print pack \"H*\", $_ ;}"
do shell script "perl -e '" & pl & "'"
-- JD
.
_______________________________________________
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.