From matt@tidbits.com Tue Jul 12 21:56:01 2016 From: Matt Neuburg To: textmate@lists.macromates.com Subject: [TxMt] Re: AppleScript template not working Date: Tue, 12 Jul 2016 14:55:58 -0700 Message-ID: In-Reply-To: <8025B024-D3D7-4088-AEDC-55558C015659@tidbits.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1222527153328844965==" --===============1222527153328844965== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > On Jul 12, 2016, at 2:43 PM, Matt Neuburg wrote: >=20 > I'm kind of amazed your script _ever_ worked. You're not even talking to Te= xtMate. And I don't see anything that would make the template text appear in = the document; you're just making a kind of "here doc". You're just sort of tr= usting that the "result" of your script will magically become the text of the= document at the right moment. Just to be more specific, here's an AppleScript that does more the sort of th= ing you're after: tell application "System Events" tell application "TextMate" to activate tell application process "TextMate" keystroke "n" using {command down} delay 1 keystroke "h" using {control down, option down, shift down} delay 1 keystroke "1" delay 1 keystroke "" keystroke return keystroke "" end tell end tell That's not the exact result you're after, but it is the sort of thing you sho= uld be doing. m. -- matt neuburg, phd =3D http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html --===============1222527153328844965==--