<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE passolo_macrotemplate SYSTEM "macrotemplate.dtd">
<passolo_macrotemplate>
<header>
	<name xml:lang="en">Operation on selected strings</name>
	<name xml:lang="zh">对选定字串进行操作</name>

	<info xml:lang="en">Does some operation on the selected strings.</info>
	<info xml:lang="zh">对选定字串进行某些操作。</info>

	<string id="MESSAGE1">
		<text xml:lang="en">No active string list found.</text>
		<text xml:lang="zh">No active string list found.</text>
	</string>

</header>

<code ext="bas">
<![CDATA[
Sub HandleSourceString(s As PslSourceString)
	' Do something with s
End Sub

Sub HandleTransString(t As PslTransString)
	' Do something with t
End Sub

Sub Main
	Dim i As Long
	Dim selcount As Long

	' Source List
	Dim srcdisp As PslSourceDisplay
	Set srcdisp = PSL.ActiveSourceDisplay
	If Not srcdisp Is Nothing Then
		selcount = srcdisp.StringCount(pslSelection)
		For i = 1 To selcount
			HandleSourceString(srcdisp.String(i, pslSelection))
		Next i
	End If

	' Translation List
	Dim trndisp As PslTransDisplay
	Set trndisp = PSL.ActiveTransDisplay
	If Not trndisp Is Nothing Then
		selcount = trndisp.StringCount(pslSelection)
		For i = 1 To selcount
			HandleTransString(trndisp.String(i, pslSelection))
		Next i
	End If

	If srcdisp Is Nothing And trndisp Is Nothing Then
		MsgBox "%MESSAGE1%"
	End If

End Sub
]]>
</code>

</passolo_macrotemplate>