<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Correction: command completion does not indent. I indent frequently (first instance) b/c I like it, etc. Sorry.</div><div>Nicolae</div><div><br></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Nicolae Garleanu <<a href="mailto:garleanu@haas.berkeley.edu">garleanu@haas.berkeley.edu</a>><br><span style="font-weight:bold">Reply-To: </span> TeX on Mac OS X Mailing List <<a href="mailto:macosx-tex@email.esm.psu.edu">macosx-tex@email.esm.psu.edu</a>><br><span style="font-weight:bold">To: </span> "<a href="mailto:macosx-tex@email.esm.psu.edu">macosx-tex@email.esm.psu.edu</a>" <<a href="mailto:macosx-tex@email.esm.psu.edu">macosx-tex@email.esm.psu.edu</a>><br><span style="font-weight:bold">Subject: </span> [OS X TeX] TexShop: macro to insert text, preserve indentation <br></div><div><br></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hi,</div><div><br></div><div>I wanted to write a macro that inserts "\item" on the line below — specifically, that behaves exactly as when I type <Enter>, the type the text. When I do that, in particular, "\item" is indented just like the previous instance of "\item". For my macro,
 the only thing I could think of was to have an empty line followed by my text ("\item"). As some of you might guess, that does what I want save for inserting the text at the very beginning of the second line, rather than preserving the indentation as when
 I type it directly in the source code. (Command completion, for instance, places the first "\item" indented, all the others follow.)</div><div><br></div><div>How could I get the desired behavior? I should also say clearly that the more explicit the answer, the better. (I have virtually no experience with Applescript, although I expect to be able to modify reasonably closely related code.) </div><div><br></div><div>Thank you.</div><div>Nicolae</div></div></div></span></body></html>