<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Since templates were discontinued I've been using this
AppleScript to make a quick HTML doc:</p>
<pre style="font:normal 1em monospace;background:#222;padding:20px;color:#FFF;"> <span style="color:#AAA;">#!/usr/bin/osascript</span>
tell application <span style="color:#33CC33;">"System Events"</span>
keystroke <span style="color:#33CC33;">"p"</span>
using {control down, option down, shift down}
keystroke <span style="color:#33CC33;">"4"</span>
<span style="color:#33CC33;">"<!DOCTYPE html>
<html lang=\"da\">
<head>
<meta charset=\"utf-8\">
<title>$1</title>
<meta name=\"description\" content=\"\">
<style type=\"text/css\" media=\"screen\">
*{margin:0;padding:0;}
$2
</style>
</head>
<body>
$0
</body>
</html>"</span>
end tell
</pre>
<p>It’s been working fine until now. I’m on beta.11.8, and I’m very
sorry, but I don’t know if the problem arose with this update or
one of the ones from last week.</p>
<p>The problem is rather unusual. It appears that System Events is
reversing the order of the commands.</p>
<p>Instead of simulating the keyboard shortcut for selecting PHP,
all of the template is inserted via keyboard simulation, then 4
for PHP is pressed and only THEN the shortcut is pressed. But it
doesn’t go back to working, if I reverse the sequence in the
command code.</p>
<p>This is what it looks like:</p>
<p><img alt="Resultat" title="Resultat"
src="cid:part1.39BB17EE.CC649860@malver.dk" height="277"
width="397"></p>
<p>Here are the settings for the command:</p>
<p><img alt="Settings" src="cid:part2.8FCA76B1.4DAF3F0D@malver.dk"
height="455" width="322"></p>
<p style="margin-top:2em;">Rasmus</p>
</body>
</html>