• 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: TIDs and other questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: TIDs and other questions
      • From: Paul Berkowitz <email@hidden>
References: 
 >TIDs and other questions (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Window title of frontmost application
  • Next by Date: Re: TIDs and other questions
  • Previous by thread: Re: TIDs and other questions
  • Next by thread: Re: TIDs and other questions
  • Index(es):
    • Date
    • Thread