• 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: App-specific URLs and the pasteboard. Need help.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: App-specific URLs and the pasteboard. Need help.


  • Subject: Re: App-specific URLs and the pasteboard. Need help.
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 18 Jan 2008 16:05:47 +0000

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


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: App-specific URLs and the pasteboard. Need help.
      • From: Duncan Champney <email@hidden>
References: 
 >App-specific URLs and the pasteboard. Need help. (From: Duncan Champney <email@hidden>)

  • Prev by Date: Re: App-specific URLs and the pasteboard. Need help.
  • Next by Date: Re: Creating a Cocoa Window in code
  • Previous by thread: App-specific URLs and the pasteboard. Need help.
  • Next by thread: Re: App-specific URLs and the pasteboard. Need help.
  • Index(es):
    • Date
    • Thread