Re: Proposed Mac::Pasteboard

[email protected]
Newsgroups perl.macosx
Organization http://groups.google.com
Message-ID <[email protected]>
On Jan 26, 12:45 am, [email protected] (Doug McNutt) wrote:
> At 03:15 +0000 1/21/08, [email protected] wrote:
>
> >Is there a module that will let one manipulate a Mac OS X pasteboard? There  does not seem to be anything on CPAN that strikes me as being for that purpose.
>
> Have a look at the tools pbcopy and pbpaste that are delivered with OS neXt.

I don't have NeXt (however it's capitalized), but tools with the same
names ship with Mac OS X. The OS X version is limited to one flavor of
data ('com.apple.traditional-mac-plain-text') and four pasteboards --
the system clipboard, the "find" pasteboard, the "ruler" pasteboard,
and the "font" pasteboard. The manual is at
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/pbcopy.1.html

I did not intend to be so limited, though the only non-text test I
have done is to copy a JPEG to the system clipboard with Graphic
Converter, send it back to a file with my software (it turned out to
be a PICT on the clipboard), open the file, and look to see that I got
the same picture back.

> There is a subtle difference between pasteboard and clipboard. NeXt has a pasteboard which sometimes refers to the current selection and not just to something that has been "copied". That allows services to do things like "execute selected text as a terminal command".

That's my understanding of the Mac OS X pasteboard. I do not intend to
support promised data in the first release, and I may never fully
support writing services (which appear to require a full-blown Mac OS
X application bundle with embedded Info.plist file) in Perl. Right now
the development plan (well, aspiration anyway) is:

1) Basic functionality
2) Promised data
3) Destination URLs
4) Hooks for translation services

Number 4 is intended to mean "If you can get the Perl code into a Mac
OS X application bundle (and I think X Code allows this, though I have
never done anything with it), I will try to supply the code to acquire
the data." I think I understand number 2, but the others are really
fuzzy to me now, and may never happen.

Tom Wyant
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.