Posting script code in these forums

OK, it looks like there are some (new) formatting issues with these forums when people try to post their scripts. I have been using a formatter script that converts the text on the clipboard to HTML and then wraps it in a pre tag, but there still seems to be some issues with certain characters. The following script has worked for me so far (although I don't post that much) - what other scripts or methods work for you?
<pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">-- script formatter
property TempFile : "SF_TempFile" -- a temporary work file
property TheWidth : "width: 720px; " -- a width attribute (deprecated in HTML 4.01)
try
set TheClipboard to (the clipboard) as string
set MyOpenFile to open for access ("/tmp/" & TempFile & ".txt" as POSIX file) with write permission
set eof of MyOpenFile to 0 -- empty the temp file
write TheClipboard to MyOpenFile
close access MyOpenFile
-- convert to HTML - see man textutil
do shell script "cd /tmp/; textutil -convert html -excludedelements '(html, head, title, body, p, span, font)' -encoding US-ASCII " & TempFile & ".txt"
-- strip the first line (<?xml ?>) and add the <pre>...</pre> wrapper
set TheText to rest of (paragraphs of (read ("/tmp/" & TempFile & ".html" as POSIX file))) as text
set TheText to "<pre title=\"this text can be pasted into the Script Editor\" style=\"font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; " & TheWidth & "color: #000000; background-color: #E0E0E0; overflow: auto\">" & TheText & "</pre>"
set the clipboard to TheText
display dialog ((count TheText) as text) & " characters placed on the clipboard" with title "Script Formatted" buttons {"OK"} default button "OK" giving up after 4
on error ErrorMessage number ErrorNumber
display alert "Error " & (ErrorNumber as string) message ErrorMessage as warning buttons {"OK"} default button "OK"
end try</pre>

Hello red_menace,
Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
I really wish they may fix this promptly.
Best regards,
Hiroto

Similar Messages

  • Formatting code on these forums

    When I copy code directly from codewarrior (with its nice colorcoding and white space and indenting) into this forum and post, everything is justified left with no colors or bolding and it's all in the forum font. I notice that some people are able to present code in these forums that looks like codewarrior code. Just wondering how one takes code from a source file and puts it in these forums looking like code should.
    Thanks,
    Maduin

    http://forum.java.sun.com/faq.jsp#messageformat

  • Off topic: posting XML/HTML in these forums

    How do you post XML to these forums? Encoding the < as > just gets interpreted as a literal, but using straight XML doesn't work because if there's overlap with HTML, the XML gets formatted as HTML. Here's an example -- if you have an XML tag called "s" (< s n a m e = " f o o " > b a r < / s > ), look what happens (because of the strikethrough HTML tag): <s name="foo">bar</s>.
    Sorry to post off-topic!
    Chris Bucchere | bdg | [email protected] | www.bdg-online.com

    Hello red_menace,
    Indeed a pre-processing code like yours is always an option for us, but from my point of view, the correct solution is for the discussions' admins to disable this meddlesome formatting feature of the new fora software.
    This new feature affects not only new posts but also the existing messages in the fora, that means it has rendered quite a few useful messages totally useless. This is actually serious data loss caused by the thoughtless software. And for what?
    After all, these discussions' boards are not chat rooms where people might want some simple input methods for fancy text formattings, but technical support fora where people frequently post programming codes, computer outputs and so forth that have many reserved symbols and notation.
    I really wish they may fix this promptly.
    Best regards,
    Hiroto

  • How to post my code in this Forum under a good format?

    can any one tell me how to post the java resource code in here? when i just copy and paste. the format of the output is not so good, i saw some one posted some code under a very good format in this Forum, how to do that?

    If you want to post code that makes it easier on someone else to cut-n-paste, then put the code inside of the [ pre] and [ pre] tags (no blank space in between). If you want code that looks pretty (i.e., with syntax highlight, etc) but hard to cut-n-paste (at least for someone like me who uses Windows WordPad as a source code editor), put the code inside of the [ code] and [ code] tags (again no spaces in between). pre is an abbreviation for preformatted text!
    ;o)
    V.V.

  • The website Kotaku brings me to a blank white page when i try do a search or click a link to an older post, it says done in the loading bar. Also had an error where I couldn't log in properly while trying to post this question on these forums.

    Yesterday I clicked the "link Facebook account" on the website www.kotaku.com.au. Prior to that I can't remember having this issue. Not sure if its related.
    My first idea was to use safe mode, which worked. so i disabled my addons in non-safe mode but it still didn't work.
    The only thing that solved the problem was clearing my cookies, so for now I have the cookies of kotaku blocked. Obviously not an ideal situation.
    I found these error message in console:
    Error: Permission denied for <http://network.alluremedia.com.au> to call method Location.toString on <http://www.kotaku.com.au>.
    Error: pageTracker is not defined
    Source File: javascript:pageTracker._trackPageview('/interaction/rollover');
    Line: 1
    I was originally going to post this as a website error, however when trying to ask this question using Firefox I was presented with my log in name and a log out button, rather than the Ask a New Question page. Once again, it worked fine when I disabled cookies.
    So now I'm thinking it may not be a single site problem.
    Can't find many useful topics on the internet, needing some help.

    Thanks for the flag J.K. - they contaced me and solved my problem.  On this account (which I created just to ask this question), I log in with my email rather than my user name (mtalldud). On the account that I was having trouble with, they told me to use my user ID instead of my email to log in and it worked. This is a bit confusing and seems a bit inconsistent but at least I don't need this temporary account any more to get into this community and find answers!

  • How do you display code in a forum post

    Hey
    Just a quick question to ask how i display my code on these message boards if im having a problem with them?
    because i can see its not a simple copy and paste
    Thanks

    It's in fact very easy. You can post code and then surround it with code tags. The new code tags look like this:
    &#123;code}
    x=y;
    z=w;
    &#123;code}
    The old code tags look this this:
    [code]
    x=y;
    z=w;
    [[/i]code]
    They work the same. If you don't feel like typing in tags, there is a "code" button right there next to the bold, italics, underline buttons... Just select your code and press the code button.

  • How do you post images in these forums

    I've been wondering for a while. How do you post like a screen shot on these forums (so I can better illustrate me questions.)

    Hi Caleb!
    How To Post Images In  Discussions
    Create a Screen Shot of the image you wish to post.
    Upload the image to an online storage facility, like one of these linked to below.
    Flickr
    ImageShack
    PhotoBucket
    Twango
    Then use HTML formatting, to insert the URL of the location.
    Use this format <img src="Insert URL Here">
    Keep the images small, and unobtrusive, when possible.
    You can also just post a Link/URL, to the image location, using this format:
    <a href="Insert URL Here">Type Title Here</a>
    Have Fun!
    ali b

  • Can someone post apple script code to tell Safari to refresh every 5 min?

    Can someone post apple script code to tell Safari to refresh every 5 min?
    thanx in advance!

    save the script as an application and checkmark the "Stay Open" box
    -- start script
    on idle
    tell application "Safari"
    activate
    set doc_url to URL of document 1
    open location doc_url
    end tell
    return 15 --<change the number 15 to the number of seconds you want between each refresh
    end idle
    -- end script
    <br>
    Mac OS X (10.4.7)

  • Post script set to asian

    i am trying to pring several pdf files and the post script is set to asian and i am unable to change the settings is there something i need to download or something so i can print these out?

    Hi Chandu,
    Have you find the solution finally? Have you tried Pavan's suggestion?
    Sorry for my lacking of code and script. If your requirement still haven't been achieved, I suggest we can ask a question in Exchange Development forum and Script Center for more professional suggestion:
    Microsoft Exchange Development forum
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
    Script Center
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Regards,
    Winnie Liang
    TechNet Community Support

  • I used to champion these forums. Now I don't give a gnat's...

    I was a contributor, a corrector, a clarifier.
    I'd write 1,500 words explaining every possible angle on the simplest of topics, sometimes revealing tricks to people who have far more experience with Photoshop than I do. I exercised painstaking detail in choosing the proper terminology and phrasing when answering questions, and I'd test everything to make sure what I posted was correct. I was an obsessive re-editor of my posts if I noticed the wording was wrong, or didn't flow well. I'd craft screen shot composites so clean you couldn't tell they weren't monitor images that could occur natively. I added arrows, and numbering, and translucent, colored-box paragraph backgrounds for descriptors, colors chosen for the best clarity I could muster. I'd bodge together difficult GIF animations and QT Movies if it would help a user understand a concept more completely.
    I was a defender, a protector, an evangelist.
    I took it personally when newbies and spammers would come in and muck the place up. I was sometimes brusque, other times gentle in trying to bring people into line with how to get the most out of their time here. I beat up on troublemakers ruthlessly, and without remorse.
    I brought the "How to Get Help Quickly" mantra to this forum after reading it elsewhere, because it was the best exposition I'd ever seen on the subject of efficient information exchange.
    I'd take the time to help troubleshoot forum problems.
    Now, I don't give a crap about what happens to this place. I'd been hoping for the best, as I had during past attempts at major forum changes.
    It's clear to me now that the planning, preparation, roll-out and fine tuning has been doomed from the start.
    Every single person involved in ramming this new system through is to blame.
    And I'm only one person. I'd guess there are hundreds of people who feel the same way I do.
    Too bad, Adobe. You totally and completely screwed up.
    I'll still visit once in awhile, because there are people here that I like.
    But as for all that content I was giving away for free—and happily, I might add—and all the cheerleading I did for this place?
    You can shove all that right up that gnat's arse and then go sit on your own thumbs and spin.
    It feels to me like you are intentionally doing almost everything in your power to discourage the type of participation I used to revel in. From slow bug fixes and promises unkept (EFF you very much, Jive–shysters) to the mere trickle of ongoing feedback and update info offhandedly tossed to us, Adobe have become slumlords, slapping paint on a building that fails to meet standard-of-living code. Sure, there are some decent new features, but they either don't work, work only part of the time, are cumbersome, and generally regarded as so slow as to inhibit any sort of lively momentum.
    I'd be ashamed and embarrassed to be the captain of this rotting ship. As a fully vested, ranking mate on this vessel, I hereby resign my commission.
    You don't deserve my help anymore.

    Phos, although I am answering your opening message, I'm not really addressing this message to you, but to everyone.
    Almost exactly a month ago, I accepted the first important job I have been offered in more that two years. I did although it had a 30 days deadline and I knew it was very difficult, if not impossible, to complete it in that time. Well, I did manage to finish it not long ago, and one of the first things I did was to come back to my once beloved forums, full of hope of being met with some important changes introduced in these 30 days.
    I am sorry to say that, so far, I have noticed only these two changes:
    1. The "Report spam..." link in the stickies now points to the correct thread, not to a locked one, something I had been asking for weeks before this 30 days interlude; and
    2. The problem for which I offered a suggestion in this post
    http://forums.adobe.com/message/1968406#1968406
    and which had received a very good solution as I reported two days later, is back here. Plus, the "Next" button doesn't work (I don't remember if it worked before the change that was reverted).
    As this forum is full of so many easy to fix complaints, seeing only these two changes in 30 days -one of which can hardly be called an improvement- was really very discouraging. However, what really got me down was reading the opening post of this thread.
    Those who haven't followed Phos' trajectory in these forums may think that he is making false pretences, or at least exagerating, about his contributions to these forums. I am one of those who can testify that he is doing neither.
    To make it short: over these so many years trying to give whatever modest help I'm capable of in the Acrobat and Reader forums, I lost count of the times I asked Phos, somewhat jokingly, to please leave the easy questions for me to answer. Each time I saw a just published easy one, I rushed to try to answer it, only to find he had done a much better job than my attempt, and had replied a several other more recent questions in the meantime. He showed an infinite patience to answer the same questions over and over again, which I admired because I don't have it and just refered the questioner to the appropriate FAQ instead -when I did manage to post before he did.
    And he did everything else he writes in his OP, never boasting about what he did and accomplished. That's why I am sorry he had to do it now, I imagine that in an attempt to put some weight to his words. Not for us, of course, but for those responsible for this unbelievably large fiasco they have so stubbornly refused to acknowledge. And we used to call a fiasco the previous one, which was nothing compared with this mess, and which was rectified!
    I am afraid that I am feeling my age, and so I'm finding that the enormous effort that too many very capable users have being putting in suggestions to improve these new forums, since the last "little fiasco" until now, to be such an gigantic waste, that I also don't feel like continuing. Had I not had this 30 days interlude with no noticeable changes, I would probably have continued by inertia for much longer, hopefully waiting for the improvements that never come, but this has opened my eyes. However, just logging in, or moving from one forum to another, is so excruciatingly slow that I find I simply do not have enough time to waste in just waiting for things to happen.
    I will miss the group spirit of the old forums, and the many persons I got to know and like and care for, although knowing that I would never meet them. But then, I am missing more of them everyday and, after all, such is life.
    Just a final thought. It is most probably true that JC has spent this week in the moutains. I would be happy to be corrected if I'm wrong, but I would say his presence has hardly been noticed, if at all, for quite a lot longer than a week. Another one of those many not at all encouraging signs.

  • Indesign Post Script name changing to back up file name

    Hi all
    I am in a pre press workflow that requires that I write a post-script file to a hot folder.
    So saving as a post-script is the only option for our entire workflow to take place.
    When saving the post script file from indesign , the name defaults to the back up file name which is
    not similar to the original file name. We deal with an extremely large number of pages
    and need for this file name to stay the same as the original not the back up. Manually putting these file names
    in is a serious chance for error and takes too much time.
    Does anyone know how to prevent the name from changing?
    Thanks for any help.

    You should be posting to the InDesign or Acrobat forum. Please repost there giving them your version of InDesign and Acrobat. Detail you method of creating the postscript file. You should be printing to file using the Adobe PDF printer instance. I only suggest the InDesign forum, since the print dialog box in InDesign is not a standard Windows Print dialog box.

  • What is the time used in these forums?

    One would tend to assume that the time shown in these forums (for example, the posting times) refer to the USA, although this could be wrong. However, there are (I think) four different time zones in that country. Maybe for the natives it is quite clear what "8:13 AM" means, but it is not at all clear for at least this one inhabitant of another country. Even acronyms such as EPT (I am not sure if I recall this correctly from the old forums) don't mean much to me.
    Wouldn't it be a good idea to specify in some clear way what time being used in these forums?

    Claudio González wrote:
    My reason for asking is that some things simply don't check. At the time of writing this message, the first topic in the list was the "What are forum points..." one, with 35 replies and the last one by Jhabrix 9 minutes ago. However, if I open the thread, I see that the last message is #35 (i.e., no posts have been deleted), it is posted by Jhabrix, but at 11:51 AM. As it's now a few minutes past 2 PM here, that's quite a lot more than 9 minutes...
    Claudio, it's just like I said before, all of the information produced by Jiveware is unreliable--more often wrong than not.  I'm not even joking around now.  It goes for virtually every statistic and piece of automated information here (because it's the most buggy software known to man ).  They just don't test enough, they obviously don't care, and they sure as heck can't write correctly functioning software.  The whole forum, front and backend, appears to be behave like an overengineered software mess.
    (There's a Java backend on this trash.  And Java developers wonder why everyone thinks they are incompetent... since there are so many Java devs around--being the most popular language--there's always people like the Jive script kiddies to give the ones that know what they're doing a bad name.)
    As for the time it's using, it probably syncs up to the time on Planet Jive--where even the Jives can't agree on what time it is because every answer is "correct"!

  • Kindly do not make these forums as only the game of points

    Hi all,
    Please stop mentioning commitments on the points as thread heading or as the part of threads.It sometimes mis guide the new persons in utilizing this forums.
    Even though every body interested to gain points, it does not mean that points is the only ultimate goal of these forums.
    And also think abt a while how threads on interview questions spiol the culture of the forums.
    With rgds,
    Anil Kumar Sharma .P

    This might be stretching the argument, but...
    In many cases, the answer 'original poster' wrote is not that original - it may be a code copy from his system which is his employer's IP (again weblogs containing slidesets used at customer site and then used in the blog on SDN comes to mind), a copy from SAP's documentation, a copy from OSS note and so on.
    If I really tell anyone "RSXXXX will get you the change log table name" as an answer, it might be a copy from another post, but really, do you think it was such an 'original' answer drafted by the original poster that an acknowledgement is necessary?
    An acknowledgement, where due, should be given I agree. But, many a times a URL opening something in another window (or same) for a two line answer is mere inconvenience for the questioner, compared to a cut-paste in the same thread. At least this is what is the decider for me. (If it is a small generic answer, just do a cut-paste, if it is a post where original thread needs to be acknowledged, mention the URL). In the end, your priority is to answer to help the questioner, why not make it easy by pasting it there in that thread? In the end, I would still think leaving it in poster's good-faith decision is the most practical option.
    In general, people gaming for points are not that successful (you and me have discussed at least one such poster on this board), and others on the board do figure out what they are up to. I know it stretches the moderator's work but this is the price SDN has to pay for success.
    As an example, if I ever quote Pizzaman's answer, I will mention the URL since he typically writes a well-formed descriptive answer and that effort needs to be appreciated, however if it is a two line code, I may paste it without bothering about mentioning the link.
    In the end, one needs to be somewhat detached with the points one gets, or not. We all evolve (initially the craving for points is more, and it subsides to a level later). At any point in time different SDNers are at different points on that evolution curve, thus causing such friction/debates.
    I take it philosophically, I know as a moderator you may not have that choice
    Apologies for too much free time (on my hand) causing such long posts (perils of on-the-bench life).

  • Has etiquette in these forums worsened? Or is it just me?

    Hey,
    So it's been about a year since I've been at these forums. I've been working on something non-java related for a while.
    But anyway, I was just browsing over the posts and noticed that the level of etiquette is lower than what it was.
    I'm seeing a lot more arguments or unrelated discussions going on in someone's question thread.
    I just read over a student post who posted a simple legitimate question about operator precedence. And the responses were so over-the-top arrogant. And then two posters started discussing and arguing over something completely unrelated on the OP's thread!
    I remember a year ago, that arrogance in these forums was VERY rare, and not tolerated by anyone. Under-researched questions or commonly asked questions were responded to with a link to a relevant page, or a few terms that the OP could look for. Nothing more was needed.
    And if the attitude of the OP doesn't appeal to someone, they just ignored it.
    Has it always been this bad? or is it just me?
    -Cuppo
    PS: And what happened to the Watercooler forum?

    I remember a year ago, that arrogance in these forums
    was VERY rare, and not tolerated by anyone.
    Under-researched questions or commonly asked
    questions were responded to with a link to a relevant
    page, or a few terms that the OP could look for.
    Nothing more was needed.
    And if the attitude of the OP doesn't appeal to
    someone, they just ignored it.
    I am sorry but you are wrong. This is not the way it was a year ago, or five years ago or eight years ago.
    Has it always been this bad? or is it just me?In some ways things are better. Less Goldie for one thing.
    In other ways things are worse. Look at this thread http://forum.java.sun.com/thread.jspa?threadID=5176699&start=0&tstart=0
    I would say it's fairly typical to have several of these a day.
    Here's another example from this week http://forum.java.sun.com/thread.jspa?threadID=5176013
    I mean. Come on. Vague questions. Lazy, lazy, lazy, lazy people with no clue seeking "teh codes". It's not surprising to me that there's off-topic chatter in some threads when this is the quality of so many of the questions.
    But it isn't just getting worse here, it's getting worse everywhere. More and more lazy nitwits think the answers to much of life's problems can be found for free on the internet without their having to work one iota to actually learn or do anything.
    -Cuppo
    PS: And what happened to the Watercooler forum?You've been gone longer than a year I guess. Sun axed the water cooler (aka the forum that shall not be named although the thought police are less active then they used to be) around 2002.

  • In These Forums Here, I Cannot Reply Or Quote

    HAHA!
    Now, I cannot Reply or Quote on my own posts. So, I can only see your solutions for this post here. I cannot Reply or Quote.
    I am using latest IE 11 with latest updates just today.
    I think that I have all settings correct. I am using for the Security tab, and Internet, the Default setting. I double checked, and when I press the Custom level... button, under Scripting, Active Scripting is Enabled. Also, other sites that require
    Javascript, are working normally. Like GMail for example, or another Windows site, that has the same:
    javascript:void(0)
    links. [http://windows.microsoft.com/en-us/windows/music-photos-video-help#music-photos-video-help=windows-7&v1h=winrttab1&v2h=win8tab1&v3h=win7tab2&v4h=winvistatab1]
    So, what do I do now?

    Hi,
    I agree with ThrashZone, delete the temp files as well as some browser history, cookies, form data, Internet Options\General\Delete...
    Reset IE if possible if the above doesn't work.
    Sometimes, too much traffic on your internet connection can also cause this kind issue when loading the website
    You can also post in the forum for further analyzing
    Forum Issues
    http://social.technet.microsoft.com/Forums/en-US/home?forum=reportabug
    Yolanda Zhu
    TechNet Community Support
    HEHE!
    Hope this helps some others too. I had ''played'' a little bit with the Advanced settings of IE11. The setting that restored my ability to Reply and Quote in these forums here, is this:
    Enable DOM Storage
    I just checked it back, and here I am!

Maybe you are looking for