使用 applescript 和 quarkxpress 将字符更改为上标

Change character to Superscript using applescript and quarkxpress

我有一个在 (m2) 中列出的不同大小的房屋列表(见下图),我想用 m2 和上标中设置的“2”替换所有这些实例。

房源列表:

我的脚本:

tell application "QuarkXPress"
tell document 1
    tell story 1 of current box
        set xx to 2
        set character style of xx to superscript
        set text of every paragraph where it is "m2" to "m" & xx
    end tell
end tell
end tell

我收到以下错误:

Can’t set «class CHSS» of 2 to superscript.

请帮忙,不确定我是不是走错了路。 非常感谢!

拔出头发后我想出了一个解决方案,希望这对其他人有帮助。

对以下脚本的更改:

tell application "QuarkXPress"
tell document 1
tell story 1 of current box

set xx to («data utxt006D» as Unicode text) & «data utxt00B2» as  Unicode text
set text of every paragraph where it is "m2" to xx

end tell
end tell
end tell