Error with <pre style = in AppleScript: < (less than) cannot be there

I find many references in using AppleScript with Microsoft Word to this type of construct,


tell application “Safari” to activate
tell application “System Events”
repeat 10 times
keystroke tab – using {shift down}
delay 1
end repeat
end tell

It will not compile. It throws error 1740
“<” can’t go there
at the first line.

I cannot find documentation for the PRE statement, which doesn’t actually seem to be an AppleScript command.

Would someone please provide guidance for when this syntax is needed? Does it need to be in some kind of wrapper?

I googled

And your sample code is garbled. Two thirds is HTML, the last third (giveortake) is AppleScript.
The HTML should go into a text (string, of old) variable.
The actual code should be moved to after the tag: starting from the top, you’ll find a > (greater than) at the end of a line. This delimits the HTML, what follows is AppleScript code.

Creating HTML from AppleScript by hand is painful.

:slight_smile: Thanks, that clears it up for me. I knew it looked like mark-up language. It was added to AppleScript code as part of a reply and I saw similar HTML in other forum sample code, so I was confused.