Skip navigation.
 
mlRe: App-specific URLs and the pasteboard. Need help.
FROM : Alastair Houghton
DATE : Fri Jan 18 17:05:47 2008

On 18 Jan 2008, at 15:27, Duncan Champney wrote:

> I build my URL string in the variable theURLString, then add it to 
> the general pasteboard using the following code:
>
>      theFW_URL = [NSURL URLWithString:theURLString];
>      [theFW_URL writeToPasteboard: thePasteBoard];
>      NSString* theURLName = [NSString stringWithFormat: 
> NSLocalizedString(@FW_URL_PREFIX ,nil), theDocumentName];
>      success = [thePasteBoard setString:theURLName forType: 
> NSStringPboardType];


Have you tried NSURLPboardType?

Or NSHTMLPboardType with HTML containing a link?

Or, for that matter, NSRTFPboardType, which I think you'll find can 
hold links too; you can make RTF fairly easily from an 
NSAttributedString, and if that string happened to contain a link 
(hint: see NSLinkAttributeName), I think you'll get the behaviour you 
want.

At present, I think you're relying on the end application to parse 
your text into a link, which won't work in many cases.

Kind regards,

Alastair.

--
http://alastairs-place.net

Related mailsAuthorDate
mlApp-specific URLs and the pasteboard. Need help. Duncan Champney Jan 18, 16:27
mlRe: App-specific URLs and the pasteboard. Need help. Steve Bird Jan 18, 16:51
mlRe: App-specific URLs and the pasteboard. Need help. Alastair Houghton Jan 18, 17:05
mlRe: App-specific URLs and the pasteboard. Need help. Alastair Houghton Jan 18, 18:21
mlRe: App-specific URLs and the pasteboard. Need help. Alastair Houghton Jan 19, 00:30
mlRe: App-specific URLs and the pasteboard. Need help. Duncan Champney Jan 19, 13:59
mlRe: App-specific URLs and the pasteboard. Need help. Jonathon Mah Jan 20, 10:49
mlRe: App-specific URLs and the pasteboard: Clipboard Viewer tool Duncan Champney Jan 20, 15:29
mlRe: App-specific URLs and the pasteboard. Need help. Duncan Champney Jan 22, 21:44
mlRe: App-specific URLs and the pasteboard. Need help. glenn andreas Jan 22, 23:46
mlRe: App-specific URLs and the pasteboard. Need help. William Bates Jan 23, 13:22