Skip navigation.
 
mlApp-specific URLs and the pasteboard. Need help.
FROM : Duncan Champney
DATE : Fri Jan 18 16:27:11 2008

I'm having problems adding my application's app-specific URL to the 
pasteboard.

My application, FractalWorks, creates fractal images. It has the 
option to create a URL that encodes all the parameters to recreate the 
image. (The app is available as a free trial if you'd like to try it 
out. Click the above link to download it from dotMac.)

I use the URL prefix "fractalworks://"

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];

My goal is to be able to paste the URL into different target 
applications (Apple's mail client, TextEdit, iChat, etc) and have it 
appear as a clickable link, with the document title as the displayed 
name, e.g. Fractalworks plot Mesh Julia. I'd also like to be able to 
paste the URL onto websites using Safari, FireFox, Sea Monkey, etc. 
Browsers generally want one of a couple of markup formats:

    <u><a href="link">clickable text</a></u>

or

    [url=link]clickable text[/url]

I could certainly add options to generate a simple string object in 
either of those formats.

The clickable link, though, has me stuck. TextEdit is the only app 
that recognizes my URLs and creates a clickable link like want it to. 
Some apps only paste the URL title as plain text, and others paste the 
body of the URL as plain text.

If I select the clickable link in TextEdit and copy it, I can paste it 
into other apps just fine. I can't figure out what format to use when 
adding my URL to the pasteboard.

Can somebody help?


Duncan Champney

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