• 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: Respecting tabs across applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Respecting tabs across applications


  • Subject: Re: Respecting tabs across applications
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 10 Jan 2012 13:20:56 -0800

On Jan 10, 2012, at 12:49 PM, James Merkel wrote:

> In my application I tab text (Helvetica 12 font) so that things line up in my application window.
> If I copy a text selection out of my app window and then look at the clipboard, the text looks the same as in my window.
> If the clipboard is then pasted into a new TextEdit window or a new TextWrangler window, the tabs don't hold.
> If the clipboard is pasted into the Xcode editor, the tabs do hold.
> How can I make sure that tabs are respected in other applications. (Or what can I do in other applications to make sure that the tabs are respected) ?

I don’t think you can get this to work everywhere. The best you can do is to make sure that the NSAttributedString you write to the pasteboard has tab stops explicitly defined in its NSParagraphStyle. That should take care of apps that handle styled text, e.g. TextEdit. But TextWrangler and Xcode and other plain-text editors define tabs as a specific number of character widths, and that number is fixed as part of the document, so pasting text wouldn’t affect it.

Also, it just occurred to me, are you using multiple consecutive tab characters to try to force things to line up, or are you setting tab stops in the paragraph style? Using multiple tabs is a sure recipe for disaster*, one of those things they warn you not to do in Word Processing 101.

—Jens

* Sorry if that sounds harsh; I’m a typography geek. Don’t get me started about double-spacing after periods…

_______________________________________________

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: Respecting tabs across applications
      • From: James Merkel <email@hidden>
References: 
 >Respecting tabs across applications (From: James Merkel <email@hidden>)

  • Prev by Date: Re: NSTimer and touch events
  • Next by Date: Re: Respecting tabs across applications
  • Previous by thread: Respecting tabs across applications
  • Next by thread: Re: Respecting tabs across applications
  • Index(es):
    • Date
    • Thread