BBEncoder - convert formatted text to BBCode

Discussion in 'Mac Apps and Mac App Store' started by kainjow, Jan 30, 2011.

  1. kainjow, Jan 30, 2011
    Last edited: Apr 23, 2011

    kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #1
    BBEncoder is a little app I put together that converts rich text to BBCode.

    Screenshots and examples:

    bbencoder_screenshot.png

    Code:
    [color=#007400]//[/color]
    [color=#007400]//  main.m[/color]
    [color=#007400]//[/color]
    
    [color=#643820]#import [/color][color=#c41a16]<Cocoa/Cocoa.h>[/color][color=#643820]
    [/color]
    [color=#aa0d91]int[/color] main([color=#aa0d91]int[/color] argc, [color=#aa0d91]char[/color] * argv[])
    {
        [color=#aa0d91]return[/color] [color=#2e0d6e]NSApplicationMain[/color](argc,  ([color=#aa0d91]const[/color] [color=#aa0d91]char[/color] **) argv);
    }
    
    Code:
    [b]tell[/b] [i][color=#0000ff]application[/color][/i] "iTunes"
        [b][color=#0000ff]play[/color][/b] ([b][color=#0000ff]next track[/color][/b])
    [b]end[/b] [b]tell[/b]
    
    Currently supported tags: [b], [u], [i], [color], [url], [left], [right], [center], [size] and [s] ([s])

    AppleScript Editor and Xcode will copy formatted text automatically, so you can paste directly into the program.

    Requires 10.5+ (PPC and Intel). Open source.
     

    Attached Files:

  2. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #2
    Thank you for this! I've been looking for something related that will streamline the ability to copy this:
    PHP:
    <a href="http://forums.macrumors.com/forumdisplay.php?f=90">MacBook Pro</a>
    ... and paste to the forum (even with a different shortcut) this:
    PHP:
    [url="http://forums.macrumors.com/forumdisplay.php?f=90"]MacBook Pro[/url]
    The closest I've been able to come is a script that does the conversion, but I'm still left with:
    1. Right-click
    2. "Copy Link HTML Tag"
    3. Click the script button on the Menu Bar
    4. Click on the URL script in the script listing
    5. Paste the reformatted string.
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    On that note, if you use Firefox, the CoLT add-on helps with this by adding a copy link as BB Code option, amongst others. It's really helpful for composing posts here.

    The BBEncoder looks pretty slick. BBEdit (no relation to BBCode) is my editor of choice and I created a clippings group for BBCode to more quickly compose posts. Parsing rich text can be a pain so congrats on dealing with it.
     
  4. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #4
    I haven't seen anything like that for Safari. It sure would come in handy!
     
  5. TUSF macrumors newbie

    Joined:
    Apr 5, 2011
    #5
    ^^ I hate to be rude, and i normally don't bump up topics like this, but I was wondering if it would be possible to modify the software to account for different sizes? See, I sometimes write literature, and i find it, irritating, to have to go back, and add in the appropriate BBcodes.

    If you don't want to, I understand. I have no issue with that.
     
  6. kainjow thread starter Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    It's something I can look into. What do you use to write the source document (for example Word or Pages)?
     
  7. paladincomp macrumors newbie

    Joined:
    Apr 16, 2011
    #7
    What a great utility! This will be used a lot as it is but it would be cool if you could add support for more tags.

    http://www.bbcode.org/reference.php

    A few that seem easier to code would be

    Line-through
    Font-size
    Center

    As i said, it's a fantastic time saver already. Thanks so much!
     
  8. kainjow thread starter Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #8
    I just uploaded version 1.1 which adds support for tags left, right, center, size and s/strike. Also the source code is now available (link in first post).
     
  9. Yechnagoth, Oct 24, 2011
    Last edited: Oct 25, 2011

    Yechnagoth macrumors newbie

    Joined:
    Oct 24, 2011
    #9
    Just as TUSF, sorry for bumping the thread, and thanks so much for making this app! Its very useful and saves a lot of time!

    I'd like to ask if there is any way you could make available the version 1.0 that didn't have size or, make a new version that allows to disable it? I'm doing big transcriptions and it is already saving me a lot of time, but I have to delete all the size codes it makes, it would be awesome if removing it was possible (it marks the size as 1 even though its like 10, but its better if it doesn't say the size at all) Nevermind! Just found the replace tool, can remove it very easily with it.

    Either way, thanks for the great app! =)
     
  10. AlexKade, Dec 27, 2011
    Last edited: Dec 27, 2011

    AlexKade macrumors newbie

    Joined:
    Dec 27, 2011
    #10
    I just downloaded the program and it keeps putting the left alignment code around everything in italics, making breaks in paragraphs around every italicized word. Can you maybe fix it so it doesn't do that? I'm spending almost as much time going through the document deleting all the align left code as I am just manually putting in the code to italicize a word. Other than that, it's a great little program. I've been looking all day for something that'll do this and it's the closest I've come to anything decent. Thanks for creating it!
     
  11. Madd the Sane macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #11
    I, too, would like to thank you for this tool. If there wasn't such a tool, I would have used my limited programming knowledge to try to write my own. Currently fimfiction doesn't allow file uploads so I had to manually add italics. A few things I noticed: it tends to set the alignment even if it's left-aligned. Perhaps an option for ignoring left alignment?
     

Share This Page