{code} in Plain Text Help
A lot of the answers are reminding people to use the {noformat}{noformat} tag. The use of that tag could be encouraged by adding {noformat}{noformat} to the "Plain Text Help" section that appears on the right during posting. Has that been tried?
It was mentioned early on when the forum update was done a couple of years back, but for some reason it either wasn't done or couldn't be done. Not sure why.
Of course there is always the FAQ page which I think details such things (it's a wiki I believe, so it can be updated by anyone as required).
Similar Messages
-
How can I get Heading 1, which can be used for posting messages, please help me in this regard
Hi Vamsi,
If I have understood your question correctly, then it means how you are going to use the Heading in the Plain Text Help in while posting a question, replying to a thread, etc.
If this is correct, then you can take the following approach in order to use the Heading. Just write h1,h2,h3,etc accordingly in front of the text which you want to mark in the beginning of the paragraph. For example,
<Heading1> use h1 like
Heading
Hope this solves your problem. You can also use the preview tab to have a preview of the text before posting.
From next time, if you can provide more elaborate data then it will be easy for other to reply promptly and accurately.
Hope this helps.
Thanks,
Samantak. -
Newbie help with sample Studio app. "Plain Text Editor"
I'm trying to make the jump from AppleScript to AppleScript Studio, and because I want to eventually write a document producing application I thought I'd start with the textbook example "Plain Text Editor" included with Xcode. I think I see how menu items are connected to "Target/Actions," and I was able to build and run it without difficulty. It's remarkable how little AppleScript had to be written to produce a rudamentary text editor. But in playing with the built application, I noticed that the Revert menu item does not work exactly as expected.
If you create a text document, and then make some change to it, and then click the Revert menu item, you get the expected little dialog asking if you want to revert to the most recently saved version, but if you then click the Revert button, the text displayed in the text view object does not revert to the original. However, something is happening, because whatever code is behind the Save, Close, and Quit menu items does seem to be "aware" that the Revert item has been invoked: because if you click one of these after Revert, the "do you want to save changes?" warning doesn't appear, just as one might expect.
The Revert menu item seems to be connected to a "Target/Action" called "revertDocumentToSaved:" which sounds perfectly reasonable. But does the fact that Revert doesn't cause the displayed editing text to revert mean that (a) there is a bug in the code behind this Target/Action, or (b) that the writer of this textbook example just didn't bother to do everything needed for the Revert item to work in an intuitive manner?
Whichever the answer, what would I do to make it work properely?
It seems like there must be some sort of connection between the text view object in the editing window, and the Close, Save, Quit suite of menu items, because the behavior of these is dependant on whether or not there are unsaved changes in the text view object. But looking through the Inspector for this object, I don't see any, neither AppleScripts, nor Outlets, nor Target/Actions. Where and for what should I be looking?
Dual 1.2 GHz Mac OS X (10.4.8)
Dual 1.2 GHz Mac OS X (10.4.8)I think -- and I'm sure someone will correct me if I'm wrong -- that this is a place where AppleScript Studio's implementation just isn't done right. Either they intended to add a "revert" handler somewhere and forgot, or else they meant to have it send an existing message and didn't.
I haven't done any document-based applications -- heck, I've only dabbled slightly in AppleScript Studio -- so there may be a "deeper" answer to this, but you might consider just hooking the menu item up to send its "choose menu item" handler to your document script, and have it react accordingly. -
One of my documents on textedit suddenly converted to plain text and i can't get it back. Help. Spent over 5 months working on it. Had tables etc. Can i get it back?
TextEdit/Preferences/New Document - Rich Text selected?
Open & Save/When Opening a file - the 2 settings unchecked? -
How can I add some help text to a plain text field?
I would like to put the basics in the plain text (formatted text) field and then some details and clarifications in the help text area. Seems like this would be easy and useful.
Thanks for your feedback. I don't think we ever thought of using the help text that way.
Randy -
Help! Every app crashes when interacting with plain text files
I recently bought a 13" i7 MacBook Air. I love its design and I found OS X Lion unbelievably fast on it, yet I find myself in a very dark situation, now.
From the Finder to iA Writer, to TextEdit, every single app crashes when working with plain text files. In Finder’s column view I don’t even have to open them: the instant one .txt is selected, Finder crashes.
Creating a new user account seems to fix the bug for that account, but I just spent one whole day copying files from my old work MacBook (where Lion opened .txt files without a problem) to the new account and losing another entire day of work because of a stupid bug is out of question. Also, I feel it would be a very temporary fix. What if the bug presented itself again? Would I have to create a third, a fourth account, and so on?
I didn’t use any migration tool because I wanted a very clean installation.
On top of that, the machine is as App Store–only as one could be. The only “internet” apps I have on it are Chrome (for the occasional Flash video), Movist (I can’t work with Quicktime’s flying controls), and nvALT. I didn’t even had the time to install the Creative Suite on this one. I can’t for the life of me think this is app–related. I suspect it’s some weird OS bug.
I work in advertising, and I do some work in Adobe’s Creative Suite but *all* my copy is stored in plain text files. I always did it that way so that my files would be future–proof. It is kind of ironic now. So please, if anyone as the slightest idea of how to fix this, please, please, help. I find myself with a brand new computer I can’t use for work.
AlessandroWhat are the files named?
Where are they being made? (What folder?) -
How to get plain text out of a multi line text field in Client Side Object Model?
I am trying to read plain text from a MultiLineTextField in a List. This is how my code looks so far:
//Get connection
ClientContext context = new ClientContext("URL");
Web site = context.Web;
context.Load(site);
context.ExecuteQuery();
//Get list collection
ListCollection lists = context.Web.Lists;
context.Load(lists);
context.ExecuteQuery();
//Get specific list
List menu = lists.GetByTitle("menu");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXML = "<View/>";
ListItemCollection dishes = menu.GetItems(camlQuery);
context.Load(menu);
context.Load(dishes);
context.ExecuteQuery();
//Iterate through all dishes
foreach(ListItem dish in dishes)
Console.WriteLine("Dish: {0}:", dish.FieldValues["Name"]);
Console.WriteLine("Price: {0}:", dish.FieldValues["Price"]);
//Here I get my problem
Console.WriteLine("Ingredients: {0}:", dish.FieldValues["Ingredients"]);
In the last line where I try to read the ingredients, I am reading from a MultiLineTextField which is set to RichText. It is also supposed to stay in RichText format, as hyperlinks are supposed to be added there. The problem is that the output not only contains
div-tags but also some weird question marks I never added to the field. I am trying to solve this issue for a couple of days now but it seems that there are only two possible solutions.
Set the field from RichText to PlainText, which is not an option in my case.
Use Regex to remove the div-tags. Please do not suggest this option. Mainly because I do not consider this to be a clean solution for this issue. Plus, I tried it and it removes the tags but those weird question marks stay.
There seems to be a third option I found
here. It is also mentioned in this
question and it seems to work. But I can not get it to work for me. This is how it looks:
string myString = item.FieldMultiLineText[Field_Name];
So I wonder what is item supposed to be here? I suppose it is not a
ListItem because in my case it does not offer a FieldMultiLineText-property.
A short, informative code snippet would be great if you decide to help me with this issue.
Thanks in advance.
Algorithmen und Datenstrukturen in C#:
TechNet WikiThank you for your reply. Unfortunately ListItem does not contain a definition for the Fields method.
Algorithmen und Datenstrukturen in C#:
TechNet Wiki
You need to use the Microsoft.SharePoint class library and then use the sharepoint version of all the list objects you are using. See below.
//Get connection
ClientContext context = new ClientContext("URL");
Web site = context.Web;
context.Load(site);
context.ExecuteQuery();
//Get list collection
SPListCollection lists = context.Web.Lists;
context.Load(lists);
context.ExecuteQuery();
//Get specific list
SPList menu = lists.GetByTitle("menu");
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXML = "<View/>";
SPListItemCollection dishes = menu.GetItems(camlQuery);
context.Load(menu);
context.Load(dishes);
context.ExecuteQuery();
//Iterate through all dishes
foreach(SPListItem dish in dishes)
Console.WriteLine("Dish: {0}:", dish.FieldValues["Name"]);
Console.WriteLine("Price: {0}:", dish.FieldValues["Price"]);
//Here I get my problem
SPFieldMultiLineText multilineField = dish.Fields.GetField("Ingredients") as SPFieldMultiLineText;
string ingredients = "";
if (multilineField != null)
ingredients = multilineField.GetFieldValueAsText(dish["Ingredients"]);
Console.WriteLine("Ingredients: {0}:", ingredients);}
I hope this helps
Alex -
Save pdf file as plain text using VBA
I am looking to save a pdf file as plain text through VBA, however I am getting the error "Security Settings Prevent access to this property or method". I had this code working in a trial version of acrobat 9.0, but I now have a licensed version through my company of Acrobat 7.0 Standard and it is not working, even after I cahnge the object reference. Please help!
Here is the code I am using in VBA:
Dim AcroXApp As Object
Dim AcroXAVDoc As Object
Dim AcroXPDDoc As Object
Set AcroXApp = CreateObject("AcroExch.App")
AcroXApp.Hide
Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")
AcroXAVDoc.Open strPDFPath, "Acrobat"
AcroXAVDoc.BringToFront
Set AcroXPDDoc = AcroXAVDoc.GetPDDoc
Dim jsObj As Object
Set jsObj = AcroXPDDoc.GetJSObject
jsObj.SaveAs strOutputFile, "com.adobe.acrobat.plain-text"
AcroXAVDoc.Close False
AcroXApp.ExitUnfortunately, Acrobat 7 is no longer supported.
-
Plain Text will not display correctly, how can i edit html?
Hello,
my beloved MacBook Pro has been a godsend, however i have found that it is incapable of displaying Plain Text, in Text Edit, Safari (View Source), or Dreamweaver's code view. Thus, i am finding it impossible to view or edit html.
the way it displays is either all jumbled and overlapping, or spread out over impossible distances. sadly i cannot post a picture.
we also have a G3 and a G4 in the house, both running 10.3, and they also have the same issue with plain text.
I have not found any topic on this, here or in google. can someone please help?
thanks,
Tobias
macbook pro 2.33 3GB Mac OS X (10.4.8)Tom, very kindly, has got me most of the way to a happy ending.
one or another font file or cache was causing the problem. i removed all fonts from Home/Library/Fonts, then ran FontFinagler, rebooted, and things display correctly.
now i must figure out how to establish which fonts are suitable suitcases to be used.
bests,
tobias
macbook pro 2.33 3GB -
Simple text Editor App.. Saving Plain Text
Hi All,
I am trying to write my first text application in cocoa... I have got a working app from an Apple tutorial, however when saving, it uses the following:
Code:
- (NSData *)dataRepresentationOfType:(NSString *)aType
NSData *data;
[self setString:[textView textStorage]];
data = [NSArchiver archivedDataWithRootObject:[self string]];
return data;
Which saves the content as not plain text. Is there anyway I can change the above to save as plain text ?
Any help / direction would be great! Thanks,Perhaps something like this will work for you:
NSString *s = [textView string];
NSData *data = [NSData dataWithBytes: [s UTF8String] length: [s length]]; -
Rejection Applicant: How to add plain text to the mail E Mail Letter?
Dear All:
I'm working with a ECC6 version.
In transaction PB60, when we do the candidate rejection activity, the E Mail letter generates a mail with empty body text, and an attachment with the letter in PDF format. The letter is OK, but I would like to know how to add some plain text to this E Mail letter. An empty mail is not a good practise.
I searched across the forums and SAP documentation, but I could not find any clue.
I would appreciate any help regarding to this matter.
Best regards
JordiHere you go ! ( you need to create Text in t-code SO10 for ID = PAML " )
Two Default texts under ID = PAML :
*MAIL-APP-INTERVIEW *EN TEXT PAML SYSTEM
MAIL-APPLICANT EN TEXT PAML SYSTEM
Personnel Management->Applicant Activities->Mail Connection ->Create standard texts for mail connection
Create standard texts for mail connection
In this step you can create the standard texts to be used in mails.
Example
u2022 Request for return of applicant file
u2022 Notification of date of job interview
Requirements
u2022 You should have assigned a standard text to the activity.
u2022 You should also have set the variables which are to be used.
u2022 Finally, you should also have made the settings for supplying the variable with values.
Standard settings
The standard system contains two examples of standard texts. You can use these examples as references to help you create your own standard texts. The standard texts have the following names:
u2022 MAIL-APPLICANT (note on an applicant activity)
u2022 MAIL-APP-INTERVIEW (note on appointment for interview)
Please note that the standard texts are stored under text ID PAML.
Activities
Now create the standard texts you require under text ID PAML.
Further notes
Every mail is made up of a heading and contents. In the first line of the standard text you enter the heading of the mail and from the second line on, the contents.
The standard default settings for style and layout are used for mails.
The SAP System treats standard texts as application data. This is why there is no automatic connection to the transport system. If you want to copy texts from one client to another within the same system, please use the functions of the transaction to create the texts. If you want to send the texts to a different system, please enter the transport manually as follows:
PgmID Obj Objectname
R3TR TEXT TEXT,XYZ,PAML,E
| | | --- Language (e.g. E for English)
| | -
Text ID (e.g. PAML for standard mails)
| -
Text name (probably not XYZ)
Text object (TEXT ist fixed)
Good luck
Saquib Khan -
Regular Expressions for converting HTML to Structured Plain Text
I'm writing a PL/SQL function that will convert HTML to plain text, but still preserve some of the formatting/line breaks. One of my challenges is in writing a regular expression to capture the text blocks while ignoring the markup. I'm trying to write an expression that will grab all of the text between start/end tags, but discard the tags. For example, to find all of the text between a start/end paragraph, I want to do something like:
REGEXP_REPLACE('<p style="text-align:center;">This is the body of the paragraph</p>', '<p.*>(.*)</p>', '\1||v_crlf' )
where \1 returns the contents of the paragraph and v_crlf (declared earlier in the function) inserts a line break. I know there are more general expressions that will remove all tags, but I want to specifically identify the tags so I can process them appropriately. This way I can easily convert HTML to plain text for email and reporting without having to keep two versions around. Any help would be greatly appreciated. Once I get this worked out, I will repost with the function code for others to use. Thanks.
Edited by: jritschel on Oct 26, 2010 9:58 AMHere's a function I wrote for an app. I'm not making in promises on it's accuracy as the app was just a proof of concept and never made it to production.
function strip_html( p_clob in clob )
return clob
is
l_out clob;
l_test number := 0;
l_max_loops constant number := 20;
i pls_integer := 0;
begin
l_out := regexp_replace(p_clob,'<br>|<br />',chr(13)||chr(10),1,0,'imn');
l_out := regexp_replace(l_out,'<p>',chr(13)||chr(10),1,0,'imn');
l_out := replace(l_out,'<li>',chr(13)||chr(10)||'*<li>');
l_out := regexp_replace(l_out,'<b>(.+?)</b>','*\1*',1,0,'imn');
l_out := regexp_replace(l_out,'<u>(.+?)</u>','_\1_',1,0,'imn');
loop
l_test := regexp_instr(l_out,'<([A-Z][A-Z0-9]*)[^>]*>.*?</\1>',1,1,0,'imn');
exit when l_test = 0 or i > l_max_loops;
l_out := regexp_replace(l_out,'<([A-Z][A-Z0-9]*)[^>]*>(.*?)</\1>','\2',1,0,'imn');
i := i + 1;
end loop;
return l_out;
end strip_html;{code}
The loop is there to handle nested HTML.
Tyler Muth
http://tylermuth.wordpress.com
"Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book
Edited by: Tyler on Oct 26, 2010 10:03 AM -
Plain Text Message from Outlook being converted to RTF thru Gateway
Hi,
I have the GW Gateway running in a Proof of Concept environment.
When GroupWise users send Plain Text format messages thru to Exchange,
the message is delivered in Rich Text Format.
HTML format is honoured through the gateway - i.e. HTML format messages
from GroupWise are delivered in HTML format.
Is there any way - switches, etc - that we can stop the conversion to
RTF thru the gateway? My users noticed this during testing when then
discovered they can edit the RTF message body in Outlook.
Thanks for your help
Phil
Phil Tuttiett, Palmerston North, New ZealandThere might be a resolve bug that would effect this positively for you.
Bug 403443 - Exchange Gateway conversion issue with RTF from Word. and Tid 7001088
if your code is older then 7-14-08 then it might be worth trying some later code to see if this bug fix helps you.
There is a Testing build that you can try. There are also several people using this testing code so I am not concerned if you try it and use it.
The most current version of the gateway can be downloaded at ftp.novell.com/outgoing/groupwise_exch_7.0.1_2008.07.22_us.zip
good luck!
>>> Phil Tuttiett<[email protected]> 2008-06-04 6:16 AM >>>
Hi,
I have the GW Gateway running in a Proof of Concept environment.
When GroupWise users send Plain Text format messages thru to Exchange,
the message is delivered in Rich Text Format.
HTML format is honoured through the gateway - i.e. HTML format messages
from GroupWise are delivered in HTML format.
Is there any way - switches, etc - that we can stop the conversion to
RTF thru the gateway? My users noticed this during testing when then
discovered they can edit the RTF message body in Outlook.
Thanks for your help
Phil
Phil Tuttiett, Palmerston North, New Zealand -
How to Improve Design for HTML, Plain Text and Multiple Recipients?
Hello there,
JavaMail programming is so fun! I first start off mixing the JavaMail code inside a servlet and then refactored it to two separate classes.
Mailer is the independent class which uses JNDI to look up config parameters, sends e-mails, and then closes the connection with the protocol.
public class Mailer {
private Session mailSession;
protected void sendMsg(String email, String subject, String body)
throws MessagingException, NamingException {
Properties props = new Properties();
InitialContext ictx = new InitialContext(props);
Session mailSession = (Session) ictx.lookup("java:/Mail");
String username = (String) props.get("mail.smtps.user");
String password = (String) props.get("mail.smtps.password");
MimeMessage message = new MimeMessage(mailSession);
message.setSubject(subject);
message.setRecipients(javax.mail.Message.RecipientType.TO,
javax.mail.internet.InternetAddress.parse(email, false));
message.setText(body);
message.saveChanges();
Transport transport = mailSession.getTransport("smtps");
try {
transport.connect(username, password);
transport.sendMessage(message, message.getAllRecipients());
Logger.getLogger(this.getClass()).warn("Message sent");
finally {
transport.close();
}MailController is just a simple Java servlet where a Mailer object is instantiated and a String is passed inside the Mailer.sendMsg() method.
public class MailController extends HttpServlet {
/** static final HTML setting for content type */
private static final String HTML = "text/html";
myapp/** static final HTML setting for content type */
private static final String PLAIN = "text/plain";
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(PLAIN);
PrintWriter out = response.getWriter();
String mailToken = TokenUtil.getEncryptedKey();
String body = "Hello there, " + "\n\n"
+ "Wanna play a game of golf?" + "\n\n"
+ "Please confirm: https://localhost:8443/myapp/confirm?token="
+ mailToken + "\n\n" + "-Golf USA";
Mailer mailer = new Mailer();
try {
mailer.sendMsg("[email protected]", "Golf Invitation!", body);
out.println("Message Sent");
catch (MessagingException e) {
e.printStackTrace();
catch (NamingException e) {
e.printStackTrace();
}Have some design issues...
If you can notice, I manually place the body of the e-mail (as a String) from inside the client (in this case, a Java Servlet). Also, I manually have to switch the content type inside the doPost().
Question(s):
(1) How can the Mailer class be set up, so it can send both HTML and plain text messages?
(2) How can the Mailer class be structured to send e-mail to multiple recipients or one user?
(3) Would both of these features / actions require writing two overloaded methods for sendMsg()?
Would appreciate it if someone could help me...
Happy programming,
MichaelOkay, I came up with this single method:
Mailer.java:
public class Mailer
private Session mailSession;
protected void sendMessage(String email, String recipient, String subject,
String plainText, String htmlText)
throws MessagingException, NamingException
Properties props = new Properties();
InitialContext ictx = new InitialContext(props);
Session mailSession = (Session) ictx.lookup("java:/Mail");
String username = (String) props.get("mail.smtps.user");
String password = (String) props.get("mail.smtps.password");
MimeMessage message = new MimeMessage(mailSession);
InternetAddress from = new InternetAddress(email);
InternetAddress to = new InternetAddress(recipient);
message.setSubject(subject);
message.setFrom(from);
message.addRecipient(Message.RecipientType.TO, to);
Multipart multipart = new MimeMultipart();
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText(plainText);
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(htmlText, "text/html");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport transport = mailSession.getTransport("smtps");
try {
transport.connect(username, password);
transport.sendMessage(message, message.getAllRecipients());
Logger.getLogger(this.getClass()).info("Message sent");
catch (Throwable t) {
Logger.getLogger(this.getClass()).error("Unable to Send Message");
t.printStackTrace();
finally {
transport.close();
}Created a MailController class to instantiate and run the Mailer class.
public class MailController extends HttpServlet {
// doPost() method()
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(PLAIN);
PrintWriter out = response.getWriter();
String mailToken = TokenUtil.getEncryptedKey();
String plainText = "Hello there, " + "\n\n"
+ "I wanna invite you to a game of golf!" + "\n\n"
+ "Please confirm: https://localhost:8443/myapp/confirm?token="
+ mailToken + "\n\n" + "-Golf USA";
String htmlText = "<H1>Golfer Challenge!</H1>";
Mailer mailer = new Mailer();
try {
String from = "[email protected]";
String recipient = "[email protected]";
String subject = "Golf Challenge";
mailer.sendMessage(from, recipient, subject, plainText, htmlText);
Logger.getLogger(
this.getClass()).info("Message Sent to: " + recipient
+ " from: " + email);
out.println("Message Sent to: " +
recipient + "\n" + " from: " + email);
catch (MessagingException e) {
e.printStackTrace();
catch (NamingException e) {
e.printStackTrace();
}Question(s):
(1) How come the Multipart Alternative only supports HTML for the second part? Can I specify it to send HTML first and plainText second?
(2) How would I send in multiple recipients? Would I have to pass in an array reference (surrounded by a for loop) inside sendMessage() as follows:
mailer.sendMessage(from, myArray, subject, plainText, htmlText);
Thank you for all of your help!
-Michael -
Well the project i was given had me writting an applet to check the users java version, and make sure it was at least 1.4.whatever. If it isnt it displays the message your java is not compatable with bla bla bla and provides a link at the bottom to the java website. This was all well and good, tossed in the button for the link and showed off the project. Only one problem, he doesnt like buttons, and wants it to appear as a plain text link. How do I do that? spent 3 days now digging and losing sleep over this so now I need to ask for your help. Thanks for the help
dani believe there are a few text components (I think JTextPane is one of them) that allow HTML code. You could just do an HTML link... I haven't actually tried this, but it might be worth looking at.
Maybe you are looking for
-
Variant as sub-item in Sales Order
Dear Experts: I have a scenario as follows: 1. i want a variant as a sub-item in the sales order with reference to a higher level item. when user will enter the KMAT article, the pop-up will come for choosing variant and the KMAT will be replaced wi
-
Packet acknowledge failed after failover
Hello, We're running MQ 3.5 SP1 EE and we are wondering how to deal with the following problem. We have a client that consists of 2 producers and 1 consumer. There is a single connection for the client. Each producer creates its own session with:crea
-
Make the panel fit the image so MouseListener only invoke when click image
I want to add MouseListener to only the image itself. So I draw the image onto a image panel, add that panel onto the main panel, then add the main panel onto the frame. However, my problem is that the size of my image panel is too large, it take up
-
I am unable to hear my callers. the vloume is to low how do I fix this?
My volume is turned up but I can barely hear my callers when I receive calls. How do I fix this?
-
HELP!! Error message 403...
I can't seem to download my purchased music. It will say that its downloading and go through all the songs but still saying its downloading 1 of 4 and then an error message pops up and says "An unknown error accurred. There was an error downloading y