【发布时间】:2013-04-01 21:30:50
【问题描述】:
我正在尝试执行以下操作:
on cleanup(x)
tell application "Finder"
clean up window 1 by x
end tell
end cleanup
cleanup("name")
然而,由于 x 变量是一个字符串,清理命令不接受它并以错误退出。有没有办法将字符串转换为命令接受的字符串或其他解决方案来取消引用变量而不使用 if,else 语句如下:
on cleanup(x)
tell application "Finder"
if x is "name" then
clean up window 1 by name
end if
end tell
end cleanup
cleanup("name")
【问题讨论】:
标签: escaping applescript quotes