缩进功能

时间:2014-02-27 09:31:17

标签: indentation spaces

我尝试编写缩进脚本。我有以下功能,但速度很慢:

function insertSpaces theLength
  repeat theLength
    put space after mySpaces
  end repeat
end insertSpaces

有更快的方法吗?

1 个答案:

答案 0 :(得分:0)

试试这个:

function insertSpaces theLength
  set the itemDel to space
  put space into item theLength of mySpaces
  return mySpaces
end insertSpaces

顺便说一句,你在功能结束时忘记了返回命令。