以下Applescript代码无法编译;编译器突出显示“case”并说:“语法错误:预期的应用程序常量或考虑但找到的属性”。我猜case
在tell application "Microsoft Word"
的上下文中具有特殊含义。我怎样才能很好地解决这个问题?
tell application "Microsoft Word"
set c to content of character 1 of selection as string
considering case
if (c is "a") then
set content of text object of selection to "A"
end if
end considering
end tell
答案 0 :(得分:1)
fireshadow52是对的......
considering case
tell application "Microsoft Word"
set c to content of character 1 of selection as string
if (c is "a") then
set content of text object of selection to "A"
end if
end tell
end considering
答案 1 :(得分:1)
我要做的是尝试将considering
块移到外面,以便它包含其他所有内容。
似乎case
是Microsoft Word的保留字,因此在tell
块内部使用该字时,只会混淆编译器,因此会出现语法错误。